Skip to content

Commit 4578915

Browse files
authored
Merge pull request #4 from langchain-ai/eugene/add_info
add info level log to sse by default
2 parents a2319c5 + 5a91b4a commit 4578915

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

mcpdoc/cli.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ def parse_args() -> argparse.Namespace:
8585
help="Transport protocol for MCP server",
8686
)
8787

88+
parser.add_argument(
89+
"--log-level",
90+
type=str,
91+
default="INFO",
92+
help=(
93+
"Log level for the server. Use one on the following: DEBUG, INFO, "
94+
"WARNING, ERROR."
95+
" (only used with --transport sse)"
96+
),
97+
)
98+
8899
# SSE-specific options
89100
parser.add_argument(
90101
"--host",
@@ -209,6 +220,7 @@ def main() -> None:
209220
settings = {
210221
"host": args.host,
211222
"port": args.port,
223+
"log_level": "INFO",
212224
}
213225

214226
# Create and run the server
@@ -218,14 +230,15 @@ def main() -> None:
218230
timeout=args.timeout,
219231
settings=settings,
220232
)
221-
print()
222-
print(SPLASH)
223-
print()
224233

225-
print(
226-
f"Launching MCPDOC server with {len(doc_sources)} doc sources",
227-
file=sys.stderr,
228-
)
234+
if args.transport == "sse":
235+
print()
236+
print(SPLASH)
237+
print()
238+
239+
print(
240+
f"Launching MCPDOC server with {len(doc_sources)} doc sources",
241+
)
229242

230243
# Pass transport-specific options
231244
server.run(transport=args.transport)

mcpdoc/main.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ def create_server(
4242
settings: dict | None = None,
4343
) -> FastMCP:
4444
"""Create the server and generate tools."""
45-
server = FastMCP(name="llms-txt", **settings)
45+
server = FastMCP(
46+
name="llms-txt",
47+
instructions=(
48+
"Use the list doc sources tool to see available documentation "
49+
"sources. Once you have a source, use fetch docs to get the "
50+
"documentation"
51+
),
52+
**settings,
53+
)
4654
httpx_client = httpx.AsyncClient(follow_redirects=follow_redirects, timeout=timeout)
4755

4856
@server.tool()

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.3"
3+
version = "0.0.4"
44
description = "Server llms-txt documentation over MCP"
55
readme = "README.md"
66
requires-python = ">=3.10"

0 commit comments

Comments
 (0)