Skip to content

Conversation

@victoraraujo105
Copy link

@victoraraujo105 victoraraujo105 commented Jan 5, 2026

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 configurations using
a prefix syntax (e.g., `mcp tools claude-code:firecrawl`).

This feature:
- Parses config source prefixes (claude-code, claude-desktop, cursor, vscode, etc.)
- Loads full server configuration including command, args, and environment variables
- Applies environment variables before spawning the server process
- Falls back to existing alias lookup if no prefix match

Example usage:
  mcp tools claude-code:firecrawl
  mcp call claude-code:myserver tool_name --params '{}'

Includes comprehensive unit tests for prefix parsing.
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