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

Commit a50261c

Browse files
authored
Merge pull request #104 from modelcontextprotocol/update-server-docs
docs: add server initialization instructions to quickstart guide
2 parents 90f0f37 + d4285d0 commit a50261c

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

quickstart/server.mdx

+17-7
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,16 @@ Forecast: {period['detailedForecast']}
220220
return "\n---\n".join(forecasts)
221221
```
222222

223+
### Running the server
224+
225+
Finally, let's initialize and run the server:
226+
227+
```python
228+
if __name__ == "__main__":
229+
# Initialize and run the server
230+
mcp.run(transport='stdio')
231+
```
232+
223233
Your server is complete! Run `uv run weather.py` to confirm that everything's working.
224234

225235
Let's now test your server from an existing MCP host, Claude for Desktop.
@@ -230,7 +240,7 @@ Let's now test your server from an existing MCP host, Claude for Desktop.
230240
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.
231241
</Note>
232242

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

236246
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.
@@ -297,7 +307,7 @@ Make sure you pass in the absolute path to your server.
297307

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

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

403413
Now let's dive into building your server.
404414

405-
## Building your server
415+
## Building your server
406416

407417
### Importing packages
408418

@@ -752,7 +762,7 @@ Let's now test your server from an existing MCP host, Claude for Desktop.
752762
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.
753763
</Note>
754764

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

758768
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.
@@ -779,7 +789,7 @@ In this case, we'll add our single weather server like so:
779789
<Tabs>
780790
<Tab title="MacOS/Linux">
781791
<CodeGroup>
782-
```json Node
792+
```json Node
783793
{
784794
"mcpServers": {
785795
"weather": {
@@ -851,7 +861,7 @@ If the hammer icon has shown up, you can now test your server by running the fol
851861
Since this is the US National Weather service, the queries will only work for US locations.
852862
</Note>
853863

854-
## What's happening under the hood
864+
## What's happening under the hood
855865

856866
When you ask a question:
857867

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

0 commit comments

Comments
 (0)