Smithery is a platform that hosts MCP (Model Context Protocol) servers as remote endpoints. This guide covers integrating these servers with the Sammy Three package.
Quick Start
Basic Smithery Configuration
Common Issues and Solutions
Content Security Policy (CSP) Errors
If you see:
Refused to connect to 'https://server.smithery.ai/...' because it violates the following Content Security Policy directive
1
Update next.config.js
Add
https://server.smithery.ai
to your CSP connect-src
directive:2
Restart Server
After updating
next.config.js
, you must restart your Next.js development server for the changes to take effect.Authentication Issues
401 or 403 Errors
Solutions:
- Verify your API key is correct and active
- Check that your profile has access to the requested MCP server
- Ensure the API key and profile are properly URL-encoded in the connection string
Connection Timeout
Timeout Issues
Solutions:
- Check if Smithery service is operational
- Verify network connectivity
Tool Discovery Failures
If connection succeeds but no tools are discovered:
1
Check Documentation
Review the MCP server documentation for available tools
2
Verify Path
Ensure the server path is correct (should end with
/mcp
)3
Enable Debug Logging
Security Considerations
API Key Management
Never hardcode API keys in your source code! Use environment variables instead.
Client-Side Security
Since MCP connections are made from the browser, your API keys will be exposed in network requests. Consider these security measures:
Server-Side Proxy
Route MCP requests through your backend
Token Rotation
Use short-lived tokens
Restrict Permissions
Limit what the API key can access
Monitor Usage
Track API key usage for anomalies
CORS Considerations
Smithery servers should handle CORS appropriately, but if you encounter CORS issues:- Verify the server supports browser-based connections
- Check if additional headers are needed in the configuration
- Consider using a proxy server for the connection
Debugging Guide
1
Enable Debug Logging
2
Check Browser Console
Look for:
- CSP violations
- Network errors
- CORS issues
3
Verify Network Tab
Check that:
- Request is being sent to correct URL
- API key and profile are in query params
- Response status and body
4
Test Connection Directly
Complete HubSpot Integration Example
- Configuration
- Event Monitoring