Usage

How do I configure HTTP request timeouts?

By default, HTTP requests timeout after 5 seconds. If you have API endpoints that take longer to respond, you can configure a custom timeout by injecting your own httpx client.

For a working example, see Configure HTTP Timeout Example.

Why are my tools not showing up in the MCP inspector?

If you add endpoints after creating and mounting the MCP server, they won’t be automatically registered as tools. You need to either:

  1. Move the MCP creation after all your endpoint definitions
  2. Call mcp.setup_server() after adding new endpoints to re-register all tools

For a working example, see Reregister Tools Example.

Can I add custom tools other than FastAPI endpoints?

Currently, FastApiMCP only supports tools that are derived from FastAPI endpoints. If you need to add custom tools that don’t correspond to API endpoints, you can:

  1. Create a FastAPI endpoint that wraps your custom functionality
  2. Contribute to the project by implementing custom tool support

Follow the discussion in issue #75 for updates on this feature request. If you have specific use cases for custom tools, please share them in the issue to help guide the implementation.

How do I test my FastApiMCP server is working?

To verify your FastApiMCP server is working properly, you can use the MCP Inspector tool. Here’s how:

  1. Start your FastAPI application
  2. Open a new terminal and run the MCP Inspector:
    npx @modelcontextprotocol/inspector node build/index.js
    
  3. Connect to your MCP server by entering the mount path URL (default: http://127.0.0.1:8000/mcp)
  4. Navigate to the Tools section and click List Tools to see all available endpoints
  5. Test an endpoint by:
    • Selecting a tool from the list
    • Filling in any required parameters
    • Clicking Run Tool to execute
  6. Check your server logs for additional debugging information if needed

This will help confirm that your MCP server is properly configured and your endpoints are accessible.

Development

Can I contribute to the project?

Yes! Please read our CONTRIBUTING.md file for detailed guidelines on how to contribute to the project and where to start.

Support

Where can I get help?