Skip to content

chore(MCP): Reference options to provide feedback in minimal server instructions#3272

Open
LysanderKie wants to merge 3 commits into
mainfrom
chore/reference-feedback-options-in-docs-mcp-server-instructions
Open

chore(MCP): Reference options to provide feedback in minimal server instructions#3272
LysanderKie wants to merge 3 commits into
mainfrom
chore/reference-feedback-options-in-docs-mcp-server-instructions

Conversation

@LysanderKie

@LysanderKie LysanderKie commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Related to langfuse/langfuse#14923

Greptile Summary

This PR adds a MCP_SERVER_INSTRUCTIONS constant to lib/mcp-handler.ts and passes it as the instructions option to createMcpHandler, 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.

  • Adds five instruction sentences covering server scope, preference ordering over authenticated app-MCP, agent-skill coordination, dynamic tool discovery, and user feedback channels.
  • Passes the joined instruction string to the createMcpHandler options object, activating the built-in instructions capability 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
Loading
%%{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
    end
Loading

Reviews (1): Last reviewed commit: "chore(MCP): Reference options to provide..." | Re-trigger Greptile

@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. docs labels Jul 9, 2026
@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langfuse-docs Error Error Jul 10, 2026 1:01pm

Request Review

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

@claude review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant