Skip to content

Commit 9858092

Browse files
author
shiraayal-tadata
committed
add FAQ
1 parent c891fe4 commit 9858092

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

FAQ.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Frequently Asked Questions (FAQ)
2+
3+
## Usage
4+
### How do I configure HTTP request timeouts?
5+
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.
6+
7+
For a working example, see [07_configure_http_timeout_example.py](examples/07_configure_http_timeout_example.py).
8+
9+
### Why are my tools not showing up in the MCP inspector?
10+
If you add endpoints after creating and mounting the MCP server, they won't be automatically registered as tools. You need to either:
11+
1. Move the MCP creation after all your endpoint definitions
12+
2. Call `mcp.setup_server()` after adding new endpoints to re-register all tools
13+
14+
For a working example, see [05_reregister_tools_example.py](examples/05_reregister_tools_example.py).
15+
16+
### Can I add custom tools other than FastAPI endpoints?
17+
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:
18+
1. Create a FastAPI endpoint that wraps your custom functionality
19+
2. Contribute to the project by implementing custom tool support
20+
21+
Follow the discussion in [issue #75](https://github.com/tadata-org/fastapi_mcp/issues/75) for updates on this feature request.
22+
If you have specific use cases for custom tools, please share them in the issue to help guide the implementation.
23+
24+
### How do I test my FastApiMCP server is working?
25+
To verify your FastApiMCP server is working properly, you can use the MCP Inspector tool. Here's how:
26+
27+
1. Start your FastAPI application
28+
2. Open a new terminal and run the MCP Inspector:
29+
```bash
30+
npx @modelcontextprotocol/inspector node build/index.js
31+
```
32+
3. Connect to your MCP server by entering the mount path URL (default: `http://127.0.0.1:8000/mcp`)
33+
4. Navigate to the `Tools` section and click `List Tools` to see all available endpoints
34+
5. Test an endpoint by:
35+
- Selecting a tool from the list
36+
- Filling in any required parameters
37+
- Clicking `Run Tool` to execute
38+
6. Check your server logs for additional debugging information if needed
39+
40+
This will help confirm that your MCP server is properly configured and your endpoints are accessible.
41+
42+
## Development
43+
44+
### Can I contribute to the project?
45+
Yes! Please read our [CONTRIBUTING.md](CONTRIBUTING.md) file for detailed guidelines on how to contribute to the project and where to start.
46+
47+
## Support
48+
49+
### Where can I get help?
50+
- Check the documentation
51+
- Open an issue on GitHub
52+
- Join our community chat [MCParty Slack community](https://join.slack.com/t/themcparty/shared_invite/zt-30yxr1zdi-2FG~XjBA0xIgYSYuKe7~Xg)

examples/03_custom_exposed_endpoints_example.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
"""
22
This example shows how to customize exposing endpoints by filtering operation IDs and tags.
3+
Notes on filtering:
4+
- You cannot use both `include_operations` and `exclude_operations` at the same time
5+
- You cannot use both `include_tags` and `exclude_tags` at the same time
6+
- You can combine operation filtering with tag filtering (e.g., use `include_operations` with `include_tags`)
7+
- When combining filters, a greedy approach will be taken. Endpoints matching either criteria will be included
38
"""
49
from examples.shared.apps.items import app
510
from examples.shared.setup import setup_logging

examples/04_separate_server_example.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
22
This example shows how to run the MCP server and the FastAPI app separately.
3+
You can create an MCP server from one FastAPI app, and mount it to a different app.
34
"""
45
from fastapi import FastAPI
56
import asyncio

0 commit comments

Comments
 (0)