Skip to content

Commit bd0f497

Browse files
authored
Merge pull request #3 from langchain-ai/eugene/mcpdoc_2
release 0.0.3
2 parents 8c9d827 + efd5958 commit bd0f497

File tree

4 files changed

+67
-22
lines changed

4 files changed

+67
-22
lines changed

README.md

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,60 @@
11
# MCP LLMS-TXT Documentation Server
22

3-
A Model Control Protocol (MCP) server for serving documentation from llms.txt files.
3+
The MCP LLMS-TXT Documentation Server is a specialized Model Control Protocol (MCP) server that delivers documentation directly from llms.txt files. It serves as a testbed for integrating documentation into IDEs via external **tools**, rather than relying solely on built-in features. While future IDEs may offer robust native support for llms.txt files, this server allows us to experiment with alternative methods, giving us full control over how documentation is retrieved and displayed.
44

5-
## Installation
5+
## Usage
66

7-
```bash
8-
pip install mcpdoc
9-
```
7+
### Cursor
108

11-
## Usage
9+
1. Install Cursor: https://www.cursor.com/en
10+
2. Launch the MCP server in **SSE** transport.
11+
12+
```shell
13+
uvx --from mcpdoc mcpdoc \
14+
--urls LangGraph:https://langchain-ai.github.io/langgraph/llms.txt \
15+
--transport sse \
16+
--port 8081
17+
--host localhost
18+
```
19+
20+
3. Add the mcp server to Cursor. Remember to put the URL as **[host]/sse** for example **http://localhost:8081/sse**.
21+
22+
4. You should be able to use it within composer now.
1223

1324
### Claude Code
1425

15-
1. Install uv
26+
1. Install Claude Code: https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/overview
27+
2. Install [uv](https://github.com/astral-sh/uv). This step is required if you want to run the MCP server in using `uvx` command. This is generally recommended as it'll simplify all the dependency management for you.
28+
3. Configure the MCP server with claude code
1629

17-
2. Add a command to claude that instructs it on how to launch the MCP Server
30+
```shell
31+
claude mcp add-json langgraph-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "mcpdoc", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt"]}' -s user
32+
```
1833

19-
```shell
20-
claude mcp add-json langgraph-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "mcpdoc", "mcpdoc", "--urls", "langgraph:https://langchain-ai.github.io/langgraph/llms.txt"]}' -s user
21-
```
34+
4. Launch claude code
2235

23-
3. Launch claude code
36+
```shell
37+
claude code
38+
```
39+
40+
Verify that the server is running by typing `/mcp` in the chat window.
41+
42+
```
43+
> /mcp
44+
```
45+
46+
5. Test it out!
47+
48+
```
49+
> Write a langgraph application with two agents that debate the merits of taking a shower.
50+
```
51+
52+
53+
This MCP server was only configured with LangGraph documentation, but you can add more documentation sources by adding more `--urls` arguments or loading it from a JSON file or a YAML file.
2454
25-
```shell
26-
claude code
27-
```
2855
29-
You can check the status of the mcp serer with `/mcp` command inside of claude
3056
3157
32-
4. Test it out! (For example, "how can i use interrupt in langgraph?")
3358
3459
3560
### Command-line Interface

mcpdoc/cli.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import yaml
1010

11+
from mcpdoc._version import __version__
1112
from mcpdoc.main import create_server, DocSource
1213
from mcpdoc.splash import SPLASH
1314

@@ -98,6 +99,15 @@ def parse_args() -> argparse.Namespace:
9899
help="Port to bind the server to (only used with --transport sse)",
99100
)
100101

102+
# Version information
103+
parser.add_argument(
104+
"--version",
105+
"-V",
106+
action="version",
107+
version=f"mcpdoc {__version__}",
108+
help="Show version information and exit",
109+
)
110+
101111
return parser.parse_args()
102112

103113

@@ -140,6 +150,8 @@ def create_doc_sources_from_urls(urls: List[str]) -> List[DocSource]:
140150
"""
141151
doc_sources = []
142152
for entry in urls:
153+
if not entry.strip():
154+
continue
143155
if ":" in entry and not entry.startswith(("http:", "https:")):
144156
# Format is name:url
145157
name, url = entry.split(":", 1)
@@ -156,11 +168,20 @@ def main() -> None:
156168
if len(sys.argv) == 1:
157169
# No arguments, print help
158170
# Use the same custom formatter as parse_args()
159-
argparse.ArgumentParser(
171+
help_parser = argparse.ArgumentParser(
160172
description="MCP LLMS-TXT Documentation Server",
161173
formatter_class=CustomFormatter,
162174
epilog=EPILOG,
163-
).print_help()
175+
)
176+
# Add version to help parser too
177+
help_parser.add_argument(
178+
"--version",
179+
"-V",
180+
action="version",
181+
version=f"mcpdoc {__version__}",
182+
help="Show version information and exit",
183+
)
184+
help_parser.print_help()
164185
sys.exit(0)
165186

166187
args = parse_args()
@@ -197,7 +218,6 @@ def main() -> None:
197218
timeout=args.timeout,
198219
settings=settings,
199220
)
200-
201221
print()
202222
print(SPLASH)
203223
print()

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcpdoc"
3-
version = "0.0.2"
3+
version = "0.0.3"
44
description = "Server llms-txt documentation over MCP"
55
readme = "README.md"
66
requires-python = ">=3.10"

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)