Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

docs: add server initialization instructions to quickstart guide #104

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions quickstart/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ Forecast: {period['detailedForecast']}
return "\n---\n".join(forecasts)
```

### Running the server

Finally, let's initialize and run the server:

```python
if __name__ == "__main__":
# Initialize and run the server
mcp.run(transport='stdio')
```

Your server is complete! Run `uv run weather.py` to confirm that everything's working.

Let's now test your server from an existing MCP host, Claude for Desktop.
Expand All @@ -230,7 +240,7 @@ Let's now test your server from an existing MCP host, Claude for Desktop.
Claude for Desktop is not yet available on Linux. Linux users can proceed to the [Building a client](/quickstart/client) tutorial to build an MCP client that connects to the server we just built.
</Note>

First, make sure you have Claude for Desktop installed. [You can install the latest version
First, make sure you have Claude for Desktop installed. [You can install the latest version
here.](https://claude.ai/download) If you already have Claude for Desktop, **make sure it's updated to the latest version.**

We'll need to configure Claude for Desktop for whichever MCP servers you want to use. To do this, open your Claude for Desktop App configuration at `~/Library/Application Support/Claude/claude_desktop_config.json` in a text editor. Make sure to create the file if it doesn't exist.
Expand Down Expand Up @@ -297,7 +307,7 @@ Make sure you pass in the absolute path to your server.

This tells Claude for Desktop:
1. There's an MCP server named "weather"
2. To launch it by running `uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather run weather`
2. To launch it by running `uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/weather run weather`

Save the file, and restart **Claude for Desktop**.
</Tab>
Expand Down Expand Up @@ -402,7 +412,7 @@ Create a `tsconfig.json` in the root of your project:

Now let's dive into building your server.

## Building your server
## Building your server

### Importing packages

Expand Down Expand Up @@ -752,7 +762,7 @@ Let's now test your server from an existing MCP host, Claude for Desktop.
Claude for Desktop is not yet available on Linux. Linux users can proceed to the [Building a client](/quickstart/client) tutorial to build an MCP client that connects to the server we just built.
</Note>

First, make sure you have Claude for Desktop installed. [You can install the latest version
First, make sure you have Claude for Desktop installed. [You can install the latest version
here.](https://claude.ai/download) If you already have Claude for Desktop, **make sure it's updated to the latest version.**

We'll need to configure Claude for Desktop for whichever MCP servers you want to use. To do this, open your Claude for Desktop App configuration at `~/Library/Application Support/Claude/claude_desktop_config.json` in a text editor. Make sure to create the file if it doesn't exist.
Expand All @@ -779,7 +789,7 @@ In this case, we'll add our single weather server like so:
<Tabs>
<Tab title="MacOS/Linux">
<CodeGroup>
```json Node
```json Node
{
"mcpServers": {
"weather": {
Expand Down Expand Up @@ -851,7 +861,7 @@ If the hammer icon has shown up, you can now test your server by running the fol
Since this is the US National Weather service, the queries will only work for US locations.
</Note>

## What's happening under the hood
## What's happening under the hood

When you ask a question:

Expand Down Expand Up @@ -953,4 +963,4 @@ For more advanced troubleshooting, check out our guide on [Debugging MCP](/docs/
>
Learn how to use LLMs like Claude to speed up your MCP development
</Card>
</CardGroup>
</CardGroup>