Skip to content

fix: serve agent instructions via MCP manifest#24

Open
nlang wants to merge 1 commit intoForLoopCodes:mainfrom
nlang:fix/mcp-manifest-instructions
Open

fix: serve agent instructions via MCP manifest#24
nlang wants to merge 1 commit intoForLoopCodes:mainfrom
nlang:fix/mcp-manifest-instructions

Conversation

@nlang
Copy link
Copy Markdown

@nlang nlang commented Mar 30, 2026

Problem

Agent instructions were served as an MCP Resource fetched from Vercel on demand.
Clients that don't auto-read Resources (e.g. Claude Code) never saw them.

The instructions field in the server manifest is auto-loaded by clients on connect —
no explicit Resource read needed.

Changes

agent-instructions.md (new file)
Agent-focused workflow guidance: when to use which tool, execution rules, anti-patterns.
Intentionally excludes contributor/architecture docs and formatting conventions that
belong in INSTRUCTIONS.md, not in the agent's context.

src/index.ts

  • Read agent-instructions.md at startup via import.meta.url-based path resolution
  • Works across npx, global install, local install, and direct node build/index.js
  • try/catch so the server starts cleanly even if the file is missing
  • Pass content via instructions in McpServer options

The existing Resource endpoint stays — clients that do read Resources still get them.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

@nlang is attempting to deploy a commit to the ForLoopCodes' projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant