From baf54771a066c1e3368006af06ecb268da24f36d Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Sat, 23 Nov 2024 19:22:43 -0600 Subject: [PATCH 1/5] Em-dash --- introduction.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/introduction.mdx b/introduction.mdx index fb35f6a..571602e 100644 --- a/introduction.mdx +++ b/introduction.mdx @@ -15,7 +15,7 @@ Choose the path that best fits your needs: icon="bolt" href="/quickstart" > - The fastest way to see MCP in action - connect example servers to Claude Desktop + The fastest way to see MCP in action—connect example servers to Claude Desktop Date: Sat, 23 Nov 2024 19:22:54 -0600 Subject: [PATCH 2/5] Fix explanation of quickstart SQLite server launching --- quickstart.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickstart.mdx b/quickstart.mdx index 2025cab..9642047 100644 --- a/quickstart.mdx +++ b/quickstart.mdx @@ -160,7 +160,7 @@ brew install node git sqlite3 This tells Claude Desktop: 1. There's an MCP server named "sqlite" - 2. Launch it using the `mcp-server-sqlite` command + 2. Launch it by running `uvx mcp-server-sqlite` 3. Connect it to your test database Save the file, and restart **Claude Desktop**. @@ -237,7 +237,7 @@ brew install node git sqlite3 This tells Claude Desktop: 1. There's an MCP server named "sqlite" - 2. Launch it using the `mcp-server-sqlite` command + 2. Launch it by running `uvx mcp-server-sqlite` 3. Connect it to your test database Save the file, and restart **Claude Desktop**. From 5190ce896dd7304a979dff6d50da877ac0b566bb Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Sat, 23 Nov 2024 19:23:05 -0600 Subject: [PATCH 3/5] Fix commands for other example servers in quickstart --- quickstart.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/quickstart.mdx b/quickstart.mdx index 9642047..f1eaf3b 100644 --- a/quickstart.mdx +++ b/quickstart.mdx @@ -325,8 +325,8 @@ Want to give Claude Desktop more local integration capabilities? Add these serve Add this to your config to let Claude Desktop read and analyze files: ```json "filesystem": { - "command": "mcp-server-filesystem", - "args": ["/Users/YOUR_USERNAME/Desktop"] + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/YOUR_USERNAME/Desktop"] } ``` @@ -335,8 +335,8 @@ Want to give Claude Desktop more local integration capabilities? Add these serve Connect Claude Desktop to your PostgreSQL database: ```json "postgres": { - "command": "mcp-server-postgres", - "args": ["postgresql://localhost/mydb"] + "command": "npx", + "args": ["-y", "@modelcontextprotocol/server-postgres", "postgresql://localhost/mydb"] } ``` From 00509dde0ef80240832c650df2128cc9f50259ad Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Sat, 23 Nov 2024 19:27:02 -0600 Subject: [PATCH 4/5] Reorder Python quickstart sessions so "try it out" is sooner --- docs/first-server/python.mdx | 164 ++++++++++++++++++----------------- 1 file changed, 83 insertions(+), 81 deletions(-) diff --git a/docs/first-server/python.mdx b/docs/first-server/python.mdx index 52d6abd..d3ace3f 100644 --- a/docs/first-server/python.mdx +++ b/docs/first-server/python.mdx @@ -285,6 +285,67 @@ Let's build your first MCP server in Python! We'll create a weather server that + + + +## Connect to Claude Desktop + + + + Add to `claude_desktop_config.json`: + + ```json + { + "mcpServers": { + "weather": { + "command": "uv", + "args": "--directory path/to/your/project run weather-service", + "env": { + "OPENWEATHER_API_KEY": "your-api-key", + } + } + } + } + ``` + + + + 1. Quit Claude completely + + 2. Start Claude again + + 3. Look for your weather server in the 🔌 menu + + + +## Try it out! + + + + Ask Claude: + + ``` + What's the current weather in San Francisco? Can you analyze the conditions and tell me if it's a good day for outdoor activities? + ``` + + + + Ask Claude: + + ``` + Can you get me a 5-day forecast for Tokyo and help me plan what clothes to pack for my trip? + ``` + + + + Ask Claude: + + ``` + Can you analyze the forecast for both Tokyo and San Francisco and tell me which city would be better for outdoor photography this week? + ``` + + + ## Understanding the code @@ -445,87 +506,6 @@ import uvicorn uvicorn.run(app, host="0.0.0.0", port=8000) ``` -## Troubleshooting - -### Installation issues - -```bash -# Check Python version -python --version - -# Reinstall dependencies -uv sync --reinstall -``` - - -### Type checking - -```bash -# Install mypy -uv add --dev pyright - -# Run type checker -uv run pyright src -``` - -## Connect to Claude Desktop - - - - Add to `claude_desktop_config.json`: - - ```json - { - "mcpServers": { - "weather": { - "command": "uv", - "args": "--directory path/to/your/project run weather-service", - "env": { - "OPENWEATHER_API_KEY": "your-api-key", - } - } - } - } - ``` - - - - 1. Quit Claude completely - - 2. Start Claude again - - 3. Look for your weather server in the 🔌 menu - - - -## Try it out! - - - - Ask Claude: - - ``` - What's the current weather in San Francisco? Can you analyze the conditions and tell me if it's a good day for outdoor activities? - ``` - - - - Ask Claude: - - ``` - Can you get me a 5-day forecast for Tokyo and help me plan what clothes to pack for my trip? - ``` - - - - Ask Claude: - - ``` - Can you analyze the forecast for both Tokyo and San Francisco and tell me which city would be better for outdoor photography this week? - ``` - - - ## Advanced features @@ -789,6 +769,28 @@ uv run pyright src +## Troubleshooting + +### Installation issues + +```bash +# Check Python version +python --version + +# Reinstall dependencies +uv sync --reinstall +``` + +### Type checking + +```bash +# Install mypy +uv add --dev pyright + +# Run type checker +uv run pyright src +``` + ## Next steps From e53c2269649ad63456a7e53b3fba287818eacb26 Mon Sep 17 00:00:00 2001 From: Justin Spahr-Summers Date: Sat, 23 Nov 2024 19:30:25 -0600 Subject: [PATCH 5/5] Fix confusing multi-step example in "prompts" --- docs/concepts/prompts.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/concepts/prompts.mdx b/docs/concepts/prompts.mdx index 91c005d..80694b6 100644 --- a/docs/concepts/prompts.mdx +++ b/docs/concepts/prompts.mdx @@ -169,7 +169,7 @@ const debugWorkflow = { role: "user", content: { type: "text", - text: "Here's an error I'm seeing:" + text: `Here's an error I'm seeing: ${error}` } }, { @@ -183,7 +183,7 @@ const debugWorkflow = { role: "user", content: { type: "text", - text: error + text: "I've tried restarting the service, but the error persists." } } ];