@@ -285,6 +285,67 @@ Let's build your first MCP server in Python! We'll create a weather server that
285
285
</Step >
286
286
</Steps >
287
287
288
+
289
+
290
+
291
+ ## Connect to Claude Desktop
292
+
293
+ <Steps >
294
+ <Step title = " Update Claude config" >
295
+ Add to ` claude_desktop_config.json ` :
296
+
297
+ ``` json
298
+ {
299
+ "mcpServers" : {
300
+ "weather" : {
301
+ "command" : " uv" ,
302
+ "args" : " --directory path/to/your/project run weather-service" ,
303
+ "env" : {
304
+ "OPENWEATHER_API_KEY" : " your-api-key" ,
305
+ }
306
+ }
307
+ }
308
+ }
309
+ ```
310
+ </Step >
311
+
312
+ <Step title = " Restart Claude" >
313
+ 1 . Quit Claude completely
314
+
315
+ 2 . Start Claude again
316
+
317
+ 3 . Look for your weather server in the 🔌 menu
318
+ </Step >
319
+ </Steps >
320
+
321
+ ## Try it out!
322
+
323
+ <AccordionGroup >
324
+ <Accordion title = " Check Current Weather" active >
325
+ Ask Claude:
326
+
327
+ ```
328
+ 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?
329
+ ```
330
+ </Accordion >
331
+
332
+ <Accordion title = " Get a Forecast" >
333
+ Ask Claude:
334
+
335
+ ```
336
+ Can you get me a 5-day forecast for Tokyo and help me plan what clothes to pack for my trip?
337
+ ```
338
+ </Accordion >
339
+
340
+ <Accordion title = " Compare Weather" >
341
+ Ask Claude:
342
+
343
+ ```
344
+ Can you analyze the forecast for both Tokyo and San Francisco and tell me which city would be better for outdoor photography this week?
345
+ ```
346
+ </Accordion >
347
+ </AccordionGroup >
348
+
288
349
## Understanding the code
289
350
290
351
<Tabs >
@@ -445,87 +506,6 @@ import uvicorn
445
506
uvicorn.run(app, host = " 0.0.0.0" , port = 8000 )
446
507
```
447
508
448
- ## Troubleshooting
449
-
450
- ### Installation issues
451
-
452
- ``` bash
453
- # Check Python version
454
- python --version
455
-
456
- # Reinstall dependencies
457
- uv sync --reinstall
458
- ```
459
-
460
-
461
- ### Type checking
462
-
463
- ``` bash
464
- # Install mypy
465
- uv add --dev pyright
466
-
467
- # Run type checker
468
- uv run pyright src
469
- ```
470
-
471
- ## Connect to Claude Desktop
472
-
473
- <Steps >
474
- <Step title = " Update Claude config" >
475
- Add to ` claude_desktop_config.json ` :
476
-
477
- ``` json
478
- {
479
- "mcpServers" : {
480
- "weather" : {
481
- "command" : " uv" ,
482
- "args" : " --directory path/to/your/project run weather-service" ,
483
- "env" : {
484
- "OPENWEATHER_API_KEY" : " your-api-key" ,
485
- }
486
- }
487
- }
488
- }
489
- ```
490
- </Step >
491
-
492
- <Step title = " Restart Claude" >
493
- 1 . Quit Claude completely
494
-
495
- 2 . Start Claude again
496
-
497
- 3 . Look for your weather server in the 🔌 menu
498
- </Step >
499
- </Steps >
500
-
501
- ## Try it out!
502
-
503
- <AccordionGroup >
504
- <Accordion title = " Check Current Weather" active >
505
- Ask Claude:
506
-
507
- ```
508
- 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?
509
- ```
510
- </Accordion >
511
-
512
- <Accordion title = " Get a Forecast" >
513
- Ask Claude:
514
-
515
- ```
516
- Can you get me a 5-day forecast for Tokyo and help me plan what clothes to pack for my trip?
517
- ```
518
- </Accordion >
519
-
520
- <Accordion title = " Compare Weather" >
521
- Ask Claude:
522
-
523
- ```
524
- Can you analyze the forecast for both Tokyo and San Francisco and tell me which city would be better for outdoor photography this week?
525
- ```
526
- </Accordion >
527
- </AccordionGroup >
528
-
529
509
## Advanced features
530
510
531
511
<Steps >
@@ -789,6 +769,28 @@ uv run pyright src
789
769
</Step >
790
770
</Steps >
791
771
772
+ ## Troubleshooting
773
+
774
+ ### Installation issues
775
+
776
+ ``` bash
777
+ # Check Python version
778
+ python --version
779
+
780
+ # Reinstall dependencies
781
+ uv sync --reinstall
782
+ ```
783
+
784
+ ### Type checking
785
+
786
+ ``` bash
787
+ # Install mypy
788
+ uv add --dev pyright
789
+
790
+ # Run type checker
791
+ uv run pyright src
792
+ ```
793
+
792
794
## Next steps
793
795
794
796
<CardGroup cols = { 2 } >
0 commit comments