feat(FDN-547): Add API request headers for MCP server tracking#464
Merged
jonathannorris merged 2 commits intochore-mcp-planning-docfrom Jul 18, 2025
Merged
feat(FDN-547): Add API request headers for MCP server tracking#464jonathannorris merged 2 commits intochore-mcp-planning-docfrom
jonathannorris merged 2 commits intochore-mcp-planning-docfrom
Conversation
JamieSinn
reviewed
Jul 18, 2025
| // Set the referrer to identify this as an MCP request | ||
| // Command will be set dynamically for each tool call | ||
| // Caller is 'mcp' to distinguish from 'cli' and other callers | ||
| setDVCReferrer('mcp', version, 'mcp') |
Member
Author
There was a problem hiding this comment.
I'm not going to worry about that distinction until we figure out how we are going to deploy this.
| */ | ||
| export function setMCPToolCommand(toolName: string): void { | ||
| // Update the command to be the tool name, keeping version and caller the same | ||
| setDVCReferrer(toolName, mcpVersion, 'mcp') |
jonathannorris
added a commit
that referenced
this pull request
Jul 23, 2025
* feat: add MCP API headers to requests * feat: add headers.ts file
jonathannorris
added a commit
that referenced
this pull request
Jul 25, 2025
* feat: add MCP API headers to requests * feat: add headers.ts file
jonathannorris
added a commit
that referenced
this pull request
Aug 11, 2025
* feat: add MCP API headers to requests * feat: add headers.ts file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: Add API request headers for MCP server tracking
Solution
commandfield to the specific MCP tool name (e.g., "list_features", "create_project")setDVCReferrerwherecallerparameter was ignoredChanges
src/mcp/utils/headers.ts- Utilities for setting MCP headerssrc/mcp/index.ts- Initialize headers on server startupsrc/mcp/utils/api.ts- Set tool-specific command before each API callsrc/api/apiClient.ts- Usecallerparameter instead of hardcoded 'cli'Result
API requests now include proper identification:
{"command":"<cli_command>","caller":"cli","version":"<version>"}{"command":"<mcp_tool>","caller":"mcp","version":"<version>"}This enables better analytics, debugging, and tracking of MCP tool usage patterns.