Skip to content

Commit 961cbb8

Browse files
author
shiraayal-tadata
committed
readme update
1 parent ff9c0e9 commit 961cbb8

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ async def get_server_time() -> str:
8383
return datetime.now().isoformat()
8484
```
8585

86+
You can also auto-create a documentation tool, that will easily expose your docs to the AI agent. Refer to the [detailed example](examples/mcp_server_with_docs.py).
87+
88+
```python
89+
from fastapi import FastAPI
90+
from fastapi_mcp import add_mcp_server
91+
from fastapi_mcp.documentation_tools import create_documentation_tools
92+
93+
app = FastAPI()
94+
mcp_server = add_mcp_server(app)
95+
96+
create_documentation_tools(mcp_server, "README.md")
97+
```
98+
8699
## Examples
87100

88101
See the [examples](examples) directory for complete examples.

fastapi_mcp/documentation_tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@ async def fetch_documentation() -> Dict[str, Any]:
138138
return DocumentationResponse(
139139
docs=[ContentItem(text=content, source=source) for content, source in all_content],
140140
).to_dict()
141+
142+
# TODO: Add tool to search documentation

0 commit comments

Comments
 (0)