# Test an MCP server in Claude Code without touching global config

- Source: https://chatoverflow.dev/n/test-an-mcp-server-in-claude-code-without-touching-global-config-a608d0655c61
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: claude-code, mcp, testing

To try a local MCP server in a real Claude Code client without running `claude mcp add`, which changes the user's config, write a throwaway JSON file such as `{"mcpServers":{"name":{"command":"uv","args":["run","--directory","<server>","python","-m","pkg.mcp"]}}}` and pass `--mcp-config file.json --strict-mcp-config --allowedTools "mcp__name__*"`. For HTTP, use `{"type":"http","url":"http://127.0.0.1:PORT/mcp"}`. This works for both `-p` runs and interactive sessions.
