What is MCP?
The Model Context Protocol (MCP) is a standardized way to connect AI agents to external tools and data sources. MCP servers expose tools that DeerFlow can automatically discover and integrate.Learn more about MCP at modelcontextprotocol.io
MCP Capabilities
File Systems
Access local or remote file systems
Databases
Query PostgreSQL, SQLite, and other databases
External APIs
Integrate GitHub, Brave Search, and more
Browser Automation
Control browsers with Puppeteer
MCP Transport Types
DeerFlow supports three MCP transport mechanisms:- stdio
- SSE (Server-Sent Events)
- HTTP
Standard input/output communication with a subprocess.Best for: Local command-line tools, Node.js scripts
Configuration
MCP servers are configured inextensions_config.json (separate from config.yaml).
1
Copy Example Configuration
2
Configure MCP Servers
Edit
extensions_config.json:extensions_config.json
3
Set Environment Variables
Set required API tokens in
.env:.env
4
Restart DeerFlow
OAuth for HTTP/SSE Servers
For HTTP and SSE transport types, DeerFlow supports OAuth token acquisition and automatic refresh.Supported Grant Types
- client_credentials
- refresh_token
OAuth 2.0 client credentials flow.
extensions_config.json
OAuth Configuration Options
DeerFlow automatically refreshes tokens before they expire based on
refresh_skew_seconds.Popular MCP Servers
Official MCP Servers
GitHub
GitHub
Filesystem
Filesystem
Read and write files in allowed directories.
PostgreSQL
PostgreSQL
Query PostgreSQL databases.
Brave Search
Brave Search
Puppeteer
Puppeteer
Browser automation and web scraping.
Community MCP Servers
Find more servers in the MCP Servers DirectoryManaging MCP Servers
Via API
Manage MCP configuration programmatically:Dynamic Reloading
DeerFlow automatically detects changes toextensions_config.json:
- Edit
extensions_config.json - Save the file
- MCP manager detects file change
- New configuration loaded automatically
- Next agent run uses updated tools
No restart required when modifying
extensions_config.json.Creating Custom MCP Servers
Create your own MCP server:1
Choose Language/Framework
MCP servers can be written in any language. Official SDKs:
- Python:
mcppackage - TypeScript:
@modelcontextprotocol/sdk
2
Implement MCP Protocol
server.ts
3
Package and Publish
package.json
4
Configure in DeerFlow
extensions_config.json
Security Considerations
Best Practices
-
Use Environment Variables for Secrets
Never hardcode:
-
Limit Filesystem Access
Avoid:
-
Disable Unused Servers
-
Review Server Code
- Check source code of community servers
- Verify npm package authenticity
- Use official servers when available
Troubleshooting
Server fails to start
Server fails to start
Check logs for errors:Common issues:
- Missing npm packages:
npxwill auto-install, but may fail - Invalid command path
- Missing environment variables
- Permission issues
Tools not appearing
Tools not appearing
Verify server is enabled:Check available tools:
OAuth authentication fails
OAuth authentication fails
Verify:
- Token URL is correct
- Client ID and secret are valid
- Scope is appropriate
- Environment variables are set
Server crashes frequently
Server crashes frequently
Add error logging to server code.Consider using
http or sse transport instead of stdio for better error handling.Wrap server execution in a restart script:Next Steps
Custom Tools
Learn about creating Python tools
Creating Skills
Build skills that use MCP tools
MCP Specification
Read the official MCP documentation
MCP Servers
Browse community MCP servers