mcp_config.json. This file defines which external tools and data sources your agent can access.
Configuration File
Create or editmcp_config.json in your project root:
Transport Types
Stdio (Local Subprocess)
For local Node.js-based MCP servers:- Node.js installed
npxavailable in PATH- Server package available on npm
SSE (Server-Sent Events)
For remote MCP servers using SSE:Streamable HTTP
For remote MCP servers using HTTP streaming:Built-in Servers
Context7
Documentation search and library information:resolve-library-id- Find library IDsget-library-docs- Fetch documentation
Memory Server
Persistent memory/knowledge graph:create_entity- Create entitiessearch_entities- Search knowledge graphupdate_entity- Update entities
Filesystem Server
Local filesystem access:.) is the root directory. Change for different paths.
Authentication
HTTP Headers
For servers requiring authentication:OAuth Tokens
For OAuth-authenticated servers, configure in.env:
OAUTH_TOKENS_PATH and automatically refreshed.
Complete Example
Custom Server Path
Change the config file path via environment variable:Verification
Check server connection on startup:Troubleshooting
Server Not Connecting
- Check JSON syntax - Validate with JSON linter
- Verify transport type - Matches server capabilities
- Check network - For remote servers
- Review logs - Error messages in startup logs
Stdio Server Issues
- Node.js not found: Install Node.js
- npx not found: Install npm (comes with Node.js)
- Package not found: Check package name on npm
Authentication Issues
- Invalid token: Check token is valid and not expired
- Missing headers: Verify
headersconfiguration - OAuth errors: Check
OAUTH_TOKENS_PATHand redirect URI
Best Practices
- Use local servers for development
- Use remote servers for production
- Secure tokens - Don’t commit tokens to git
- Test connections - Verify on startup
- Monitor usage - Watch for rate limits
Next Steps
- See MCP Integration Guide for usage
- Check Tool Development for creating tools
- Review Environment Variables for MCP settings