Skip to content

Conversation

@victoraraujo105
Copy link

Summary

Add support for running MCP servers directly from IDE/editor configs using a prefix syntax like claude-code:firecrawl or cursor:myserver.

This loads the full server config (command, args, env vars) from the specified config source and runs the server with proper environment.

Problem solved: Previously, mcp alias add only stored the command string, losing environment variables. This feature lets users leverage their existing IDE configs without re-registering servers.

Supported Prefixes

  • claude-code (from ~/.claude.json)
  • claude-desktop (from Claude Desktop config)
  • cursor (from Cursor settings)
  • vscode / vscode-insiders
  • windsurf

Usage Examples

# Use firecrawl server from Claude Code config (with env vars!)
mcp tools claude-code:firecrawl

# Call a tool on a server from Cursor config
mcp call cursor:myserver tool_name --params '{"key": "value"}'

# Use playwright from Claude Desktop
mcp tools claude-desktop:playwright

# Mix with existing syntax
mcp tools claude-code:firecrawl   # From Claude config
mcp tools myalias                  # From aliases.json
mcp tools npx -y @mcp/server       # Direct command

Changes

  • Add ParseConfigPrefix() to parse source:server format
  • Add GetServerFromConfigSource() to load server config from IDE configs
  • Update CreateClientFunc to handle prefix syntax before alias lookup
  • Add comprehensive unit tests for prefix parsing (13 test cases)

Test Plan

  • All existing tests pass (make test)
  • Linter passes (make lint)
  • Tested with real Claude Code config (~/.claude.json)
  • Verified env vars are properly passed to spawned server

Notes

  • Headers for SSE servers are not yet supported (noted in code)
  • Uses existing scanMCPServersConfig and scanVSCodeConfig functions from configs.go

…nfigs

Add support for running MCP servers directly from IDE/editor configs using
a prefix syntax like 'claude-code:firecrawl' or 'cursor:myserver'.

This loads the full server config (command, args, env vars) from the
specified config source and runs the server with proper environment.

Supported prefixes:
- claude-code (from ~/.claude.json)
- claude-desktop (from Claude Desktop config)
- cursor (from Cursor settings)
- vscode / vscode-insiders
- windsurf

Example usage:
  mcp tools claude-code:firecrawl
  mcp call claude-code:firecrawl firecrawl_search --params '{"query": "test"}'

Changes:
- Add ParseConfigPrefix() to parse 'source:server' format
- Add GetServerFromConfigSource() to load server config from IDE configs
- Update CreateClientFunc to handle prefix syntax before alias lookup
- Add comprehensive unit tests for prefix parsing
@victoraraujo105 victoraraujo105 force-pushed the feat/config-source-prefix branch from 7cb04f2 to 21fd12d Compare January 5, 2026 00:54
@victor-software-house victor-software-house closed this by deleting the head repository Jan 5, 2026
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.

2 participants