chore(MCP): Reference options to provide feedback in minimal server instructions#3272
chore(MCP): Reference options to provide feedback in minimal server instructions#3272LysanderKie wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@claude review |
There was a problem hiding this comment.
LGTM — adds static instruction text to the MCP server config, no logic changes.
Extended reasoning...
Overview
This PR adds a static MCP_SERVER_INSTRUCTIONS string to lib/mcp-handler.ts and passes it as the instructions option to createMcpHandler. The instructions describe when to use this docs MCP server versus authenticated Langfuse app tools/agent skills, and reference options for providing feedback (GitHub issue or submitFeedback tool). No tool definitions, request handling, or auth logic is touched.
Security risks
None. The added content is a static English-language guidance string embedded in the server configuration; it does not accept user input, interact with external systems, or affect authentication/authorization. The instructions themselves explicitly caution against sending secrets or customer data via feedback tools.
Level of scrutiny
Low. This is a docs/config-only tweak with a single-file diff of ~10 lines. The change follows established MCP SDK patterns (instructions is a documented field on the server) and has clear, self-contained intent.
Other factors
No prior reviews or comments on this PR. No bugs were flagged by the bug hunting system. Related upstream PR (langfuse/langfuse#14923) provides context on the feedback-tool referenced in the instructions.
Related to langfuse/langfuse#14923
Greptile Summary
This PR adds a
MCP_SERVER_INSTRUCTIONSconstant tolib/mcp-handler.tsand passes it as theinstructionsoption tocreateMcpHandler, which was previously receiving an empty object{}. The instructions guide AI agents on when to use the docs MCP server vs. the authenticated Langfuse app MCP server, and include a policy for surfacing feedback options to users.createMcpHandleroptions object, activating the built-ininstructionscapability that was previously unused.Confidence Score: 5/5
Safe to merge — the change is purely additive, injecting static instruction text into the MCP server configuration with no logic changes.
The diff is small and self-contained: a new string constant is defined and passed into an already-existing options slot that was previously empty. No existing tool behavior, data flow, or API surface is altered. The instruction text itself is well-scoped, includes a sensible privacy reminder before feedback submission, and does not introduce any executable code paths.
No files require special attention.
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Agent as AI Agent / MCP Client participant DocsMCP as Docs MCP Server (langfuse-docs) participant AppMCP as Langfuse App MCP (authenticated) participant GH as GitHub Issues Agent->>DocsMCP: initialize / list tools DocsMCP-->>Agent: tool list + MCP_SERVER_INSTRUCTIONS Note over Agent: Reads instructions: scope, prefer app-MCP for project data, agent skills for workflows Agent->>DocsMCP: searchLangfuseDocs(query) DocsMCP-->>Agent: synthesized answer alt User wants project data Agent->>AppMCP: prompts / scores / feedback AppMCP-->>Agent: project-scoped result end alt User wants to submit feedback Agent->>Agent: ask permission + show payload alt app-MCP available Agent->>AppMCP: submitFeedback(payload) else Agent->>GH: open issue in langfuse-docs end end%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Agent as AI Agent / MCP Client participant DocsMCP as Docs MCP Server (langfuse-docs) participant AppMCP as Langfuse App MCP (authenticated) participant GH as GitHub Issues Agent->>DocsMCP: initialize / list tools DocsMCP-->>Agent: tool list + MCP_SERVER_INSTRUCTIONS Note over Agent: Reads instructions: scope, prefer app-MCP for project data, agent skills for workflows Agent->>DocsMCP: searchLangfuseDocs(query) DocsMCP-->>Agent: synthesized answer alt User wants project data Agent->>AppMCP: prompts / scores / feedback AppMCP-->>Agent: project-scoped result end alt User wants to submit feedback Agent->>Agent: ask permission + show payload alt app-MCP available Agent->>AppMCP: submitFeedback(payload) else Agent->>GH: open issue in langfuse-docs end endReviews (1): Last reviewed commit: "chore(MCP): Reference options to provide..." | Re-trigger Greptile