Skip to content

Commit 921fe07

Browse files
release 0.0.5: Update / improve the tool descriptions (#8)
Currently I add this workflow to Cursor. We should embed this in the tool itself. ``` use the langgraph-docs-mcp server to answer any LangGraph questions -- + call list_doc_sources tool to get the available llms.txt file + call fetch_docs tool to read it + reflect on the urls in llms.txt + reflect on the input question + call fetch_docs on any urls relevant to the question + use this to answer the question ``` --------- Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
1 parent 0e688fe commit 921fe07

File tree

3 files changed

+34
-6
lines changed

3 files changed

+34
-6
lines changed

mcpdoc/main.py

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,17 @@ def create_server(
4141
timeout: float = 10,
4242
settings: dict | None = None,
4343
) -> FastMCP:
44-
"""Create the server and generate tools."""
44+
"""Create the server and generate documentation retrieval tools.
45+
46+
Args:
47+
doc_source: List of documentation sources to make available
48+
follow_redirects: Whether to follow HTTP redirects when fetching docs
49+
timeout: HTTP request timeout in seconds
50+
settings: Additional settings to pass to FastMCP
51+
52+
Returns:
53+
A FastMCP server instance configured with documentation tools
54+
"""
4555
server = FastMCP(
4656
name="llms-txt",
4757
instructions=(
@@ -55,7 +65,14 @@ def create_server(
5565

5666
@server.tool()
5767
def list_doc_sources() -> str:
58-
"""List all available doc sources. Always use this first."""
68+
"""List all available documentation sources.
69+
70+
This is the first tool you should call in the documentation workflow.
71+
It provides URLs to llms.txt files that the user has made available.
72+
73+
Returns:
74+
A string containing a formatted list of documentation sources with their URLs
75+
"""
5976
content = ""
6077
for entry in doc_source:
6178
name = entry.get("name", "") or extract_domain(entry["llms_txt"])
@@ -68,9 +85,19 @@ def list_doc_sources() -> str:
6885

6986
@server.tool()
7087
async def fetch_docs(url: str) -> str:
71-
"""Use this to fetch documentation from a given URL.
88+
"""Fetch and parse documentation from a given URL.
89+
90+
Use this tool after list_doc_sources to:
91+
1. First fetch the llms.txt file from a documentation source
92+
2. Analyze the URLs listed in the llms.txt file
93+
3. Then fetch specific documentation pages relevant to the user's question
94+
95+
Args:
96+
url: The URL to fetch documentation from. Must be from an allowed domain.
7297
73-
Always use list doc sources before fetching documents.
98+
Returns:
99+
The fetched documentation content converted to markdown, or an error message
100+
if the request fails or the URL is not from an allowed domain.
74101
"""
75102
nonlocal allowed_domains
76103
if not any(url.startswith(domain) for domain in allowed_domains):

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
[project]
22
name = "mcpdoc"
3-
version = "0.0.4"
3+
version = "0.0.5"
44
description = "Server llms-txt documentation over MCP"
55
readme = "README.md"
6+
license = "MIT"
67
requires-python = ">=3.10"
78
dependencies = [
89
"httpx>=0.28.1",

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)