@sylphai/adal-cli-linux-x64 0.2.3 → 0.3.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/adal-cli.js +545 -499
  2. package/backend/adal-backend/_internal/base_library.zip +0 -0
  3. package/backend/adal-backend/_internal/deep_research/models/model_pricing.json +14 -1
  4. package/backend/adal-backend/_internal/{mcp-1.22.0.dist-info → mcp-1.13.1.dist-info}/METADATA +31 -347
  5. package/backend/adal-backend/_internal/mcp-1.13.1.dist-info/RECORD +88 -0
  6. package/backend/adal-backend/_internal/rpds/rpds.cpython-312-x86_64-linux-gnu.so +0 -0
  7. package/backend/adal-backend/adal-backend +0 -0
  8. package/package.json +1 -1
  9. package/backend/adal-backend/_internal/_cffi_backend.cpython-312-x86_64-linux-gnu.so +0 -0
  10. package/backend/adal-backend/_internal/cryptography/hazmat/bindings/_rust.abi3.so +0 -0
  11. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/METADATA +0 -139
  12. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/RECORD +0 -108
  13. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/WHEEL +0 -5
  14. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/licenses/LICENSE +0 -3
  15. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/licenses/LICENSE.APACHE +0 -202
  16. package/backend/adal-backend/_internal/cryptography-46.0.3.dist-info/licenses/LICENSE.BSD +0 -27
  17. package/backend/adal-backend/_internal/mcp-1.22.0.dist-info/INSTALLER +0 -1
  18. package/backend/adal-backend/_internal/mcp-1.22.0.dist-info/RECORD +0 -94
  19. package/backend/adal-backend/_internal/openai_agents-0.2.11.dist-info/INSTALLER +0 -1
  20. package/backend/adal-backend/_internal/openai_agents-0.2.11.dist-info/METADATA +0 -352
  21. package/backend/adal-backend/_internal/openai_agents-0.2.11.dist-info/RECORD +0 -109
  22. package/backend/adal-backend/_internal/openai_agents-0.2.11.dist-info/WHEEL +0 -4
  23. package/backend/adal-backend/_internal/openai_agents-0.2.11.dist-info/licenses/LICENSE +0 -21
  24. /package/backend/adal-backend/_internal/{setuptools/_vendor/jaraco → jaraco}/text/Lorem ipsum.txt +0 -0
  25. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_asyncio.cpython-312-x86_64-linux-gnu.so +0 -0
  26. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_bisect.cpython-312-x86_64-linux-gnu.so +0 -0
  27. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_blake2.cpython-312-x86_64-linux-gnu.so +0 -0
  28. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_bz2.cpython-312-x86_64-linux-gnu.so +0 -0
  29. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_cn.cpython-312-x86_64-linux-gnu.so +0 -0
  30. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_hk.cpython-312-x86_64-linux-gnu.so +0 -0
  31. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_iso2022.cpython-312-x86_64-linux-gnu.so +0 -0
  32. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_jp.cpython-312-x86_64-linux-gnu.so +0 -0
  33. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_kr.cpython-312-x86_64-linux-gnu.so +0 -0
  34. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_codecs_tw.cpython-312-x86_64-linux-gnu.so +0 -0
  35. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_contextvars.cpython-312-x86_64-linux-gnu.so +0 -0
  36. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_csv.cpython-312-x86_64-linux-gnu.so +0 -0
  37. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_ctypes.cpython-312-x86_64-linux-gnu.so +0 -0
  38. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_datetime.cpython-312-x86_64-linux-gnu.so +0 -0
  39. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_decimal.cpython-312-x86_64-linux-gnu.so +0 -0
  40. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_elementtree.cpython-312-x86_64-linux-gnu.so +0 -0
  41. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_hashlib.cpython-312-x86_64-linux-gnu.so +0 -0
  42. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_heapq.cpython-312-x86_64-linux-gnu.so +0 -0
  43. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_json.cpython-312-x86_64-linux-gnu.so +0 -0
  44. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_lzma.cpython-312-x86_64-linux-gnu.so +0 -0
  45. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_md5.cpython-312-x86_64-linux-gnu.so +0 -0
  46. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_multibytecodec.cpython-312-x86_64-linux-gnu.so +0 -0
  47. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_multiprocessing.cpython-312-x86_64-linux-gnu.so +0 -0
  48. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_opcode.cpython-312-x86_64-linux-gnu.so +0 -0
  49. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_pickle.cpython-312-x86_64-linux-gnu.so +0 -0
  50. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_posixshmem.cpython-312-x86_64-linux-gnu.so +0 -0
  51. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_posixsubprocess.cpython-312-x86_64-linux-gnu.so +0 -0
  52. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_queue.cpython-312-x86_64-linux-gnu.so +0 -0
  53. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_random.cpython-312-x86_64-linux-gnu.so +0 -0
  54. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_sha1.cpython-312-x86_64-linux-gnu.so +0 -0
  55. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_sha2.cpython-312-x86_64-linux-gnu.so +0 -0
  56. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_sha3.cpython-312-x86_64-linux-gnu.so +0 -0
  57. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_socket.cpython-312-x86_64-linux-gnu.so +0 -0
  58. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_sqlite3.cpython-312-x86_64-linux-gnu.so +0 -0
  59. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_ssl.cpython-312-x86_64-linux-gnu.so +0 -0
  60. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_statistics.cpython-312-x86_64-linux-gnu.so +0 -0
  61. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_struct.cpython-312-x86_64-linux-gnu.so +0 -0
  62. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_uuid.cpython-312-x86_64-linux-gnu.so +0 -0
  63. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/_zoneinfo.cpython-312-x86_64-linux-gnu.so +0 -0
  64. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/array.cpython-312-x86_64-linux-gnu.so +0 -0
  65. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/binascii.cpython-312-x86_64-linux-gnu.so +0 -0
  66. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/fcntl.cpython-312-x86_64-linux-gnu.so +0 -0
  67. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/grp.cpython-312-x86_64-linux-gnu.so +0 -0
  68. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/math.cpython-312-x86_64-linux-gnu.so +0 -0
  69. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/mmap.cpython-312-x86_64-linux-gnu.so +0 -0
  70. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/pyexpat.cpython-312-x86_64-linux-gnu.so +0 -0
  71. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/readline.cpython-312-x86_64-linux-gnu.so +0 -0
  72. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/resource.cpython-312-x86_64-linux-gnu.so +0 -0
  73. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/select.cpython-312-x86_64-linux-gnu.so +0 -0
  74. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/syslog.cpython-312-x86_64-linux-gnu.so +0 -0
  75. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/termios.cpython-312-x86_64-linux-gnu.so +0 -0
  76. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/unicodedata.cpython-312-x86_64-linux-gnu.so +0 -0
  77. /package/backend/adal-backend/_internal/{python3.12/lib-dynload → lib-dynload}/zlib.cpython-312-x86_64-linux-gnu.so +0 -0
  78. /package/backend/adal-backend/_internal/{cryptography-46.0.3.dist-info → mcp-1.13.1.dist-info}/INSTALLER +0 -0
  79. /package/backend/adal-backend/_internal/{mcp-1.22.0.dist-info → mcp-1.13.1.dist-info}/WHEEL +0 -0
  80. /package/backend/adal-backend/_internal/{mcp-1.22.0.dist-info → mcp-1.13.1.dist-info}/entry_points.txt +0 -0
  81. /package/backend/adal-backend/_internal/{mcp-1.22.0.dist-info → mcp-1.13.1.dist-info}/licenses/LICENSE +0 -0
@@ -23,6 +23,19 @@
23
23
  "providers": {
24
24
  "anthropic": {
25
25
  "models": {
26
+ "claude-opus-4-5-20251101": {
27
+ "display_name": "Claude Opus 4.5",
28
+ "input_price_per_mtok": 5.0,
29
+ "cached_input_price_per_mtok": 0.5,
30
+ "cache_write_price_per_mtok": 6.25,
31
+ "output_price_per_mtok": 25.0,
32
+ "cache_discount_percent": 90,
33
+ "cache_write_markup_percent": 25,
34
+ "supports_caching": true,
35
+ "supports_thinking": true,
36
+ "model_type": "flagship",
37
+ "notes": "Latest flagship, thinking model, 67% cheaper than Opus 4/4.1"
38
+ },
26
39
  "claude-opus-4-1": {
27
40
  "display_name": "Claude Opus 4.1",
28
41
  "input_price_per_mtok": 15.0,
@@ -34,7 +47,7 @@
34
47
  "supports_caching": true,
35
48
  "supports_thinking": true,
36
49
  "model_type": "flagship",
37
- "notes": "Latest flagship, thinking model"
50
+ "notes": "Previous flagship, thinking model"
38
51
  },
39
52
  "claude-opus-4": {
40
53
  "display_name": "Claude Opus 4",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp
3
- Version: 1.22.0
3
+ Version: 1.13.1
4
4
  Summary: Model Context Protocol SDK
5
5
  Project-URL: Homepage, https://modelcontextprotocol.io
6
6
  Project-URL: Repository, https://github.com/modelcontextprotocol/python-sdk
@@ -25,13 +25,10 @@ Requires-Dist: httpx>=0.27.1
25
25
  Requires-Dist: jsonschema>=4.20.0
26
26
  Requires-Dist: pydantic-settings>=2.5.2
27
27
  Requires-Dist: pydantic<3.0.0,>=2.11.0
28
- Requires-Dist: pyjwt[crypto]>=2.10.1
29
28
  Requires-Dist: python-multipart>=0.0.9
30
29
  Requires-Dist: pywin32>=310; sys_platform == 'win32'
31
30
  Requires-Dist: sse-starlette>=1.6.1
32
31
  Requires-Dist: starlette>=0.27
33
- Requires-Dist: typing-extensions>=4.9.0
34
- Requires-Dist: typing-inspection>=0.4.1
35
32
  Requires-Dist: uvicorn>=0.31.1; sys_platform != 'emscripten'
36
33
  Provides-Extra: cli
37
34
  Requires-Dist: python-dotenv>=1.0.0; extra == 'cli'
@@ -52,8 +49,8 @@ Description-Content-Type: text/markdown
52
49
  [![MIT licensed][mit-badge]][mit-url]
53
50
  [![Python Version][python-badge]][python-url]
54
51
  [![Documentation][docs-badge]][docs-url]
55
- [![Protocol][protocol-badge]][protocol-url]
56
52
  [![Specification][spec-badge]][spec-url]
53
+ [![GitHub Discussions][discussions-badge]][discussions-url]
57
54
 
58
55
  </div>
59
56
 
@@ -75,33 +72,22 @@ Description-Content-Type: text/markdown
75
72
  - [Prompts](#prompts)
76
73
  - [Images](#images)
77
74
  - [Context](#context)
78
- - [Getting Context in Functions](#getting-context-in-functions)
79
- - [Context Properties and Methods](#context-properties-and-methods)
80
75
  - [Completions](#completions)
81
76
  - [Elicitation](#elicitation)
82
77
  - [Sampling](#sampling)
83
78
  - [Logging and Notifications](#logging-and-notifications)
84
79
  - [Authentication](#authentication)
85
80
  - [FastMCP Properties](#fastmcp-properties)
86
- - [Session Properties and Methods](#session-properties-and-methods)
81
+ - [Session Properties](#session-properties-and-methods)
87
82
  - [Request Context Properties](#request-context-properties)
88
83
  - [Running Your Server](#running-your-server)
89
84
  - [Development Mode](#development-mode)
90
85
  - [Claude Desktop Integration](#claude-desktop-integration)
91
86
  - [Direct Execution](#direct-execution)
92
87
  - [Streamable HTTP Transport](#streamable-http-transport)
93
- - [CORS Configuration for Browser-Based Clients](#cors-configuration-for-browser-based-clients)
94
88
  - [Mounting to an Existing ASGI Server](#mounting-to-an-existing-asgi-server)
95
- - [StreamableHTTP servers](#streamablehttp-servers)
96
- - [Basic mounting](#basic-mounting)
97
- - [Host-based routing](#host-based-routing)
98
- - [Multiple servers with path configuration](#multiple-servers-with-path-configuration)
99
- - [Path configuration at initialization](#path-configuration-at-initialization)
100
- - [SSE servers](#sse-servers)
101
89
  - [Advanced Usage](#advanced-usage)
102
90
  - [Low-Level Server](#low-level-server)
103
- - [Structured Output Support](#structured-output-support)
104
- - [Pagination (Advanced)](#pagination-advanced)
105
91
  - [Writing MCP Clients](#writing-mcp-clients)
106
92
  - [Client Display Utilities](#client-display-utilities)
107
93
  - [OAuth Authentication for Clients](#oauth-authentication-for-clients)
@@ -118,12 +104,12 @@ Description-Content-Type: text/markdown
118
104
  [mit-url]: https://github.com/modelcontextprotocol/python-sdk/blob/main/LICENSE
119
105
  [python-badge]: https://img.shields.io/pypi/pyversions/mcp.svg
120
106
  [python-url]: https://www.python.org/downloads/
121
- [docs-badge]: https://img.shields.io/badge/docs-python--sdk-blue.svg
122
- [docs-url]: https://modelcontextprotocol.github.io/python-sdk/
123
- [protocol-badge]: https://img.shields.io/badge/protocol-modelcontextprotocol.io-blue.svg
124
- [protocol-url]: https://modelcontextprotocol.io
107
+ [docs-badge]: https://img.shields.io/badge/docs-modelcontextprotocol.io-blue.svg
108
+ [docs-url]: https://modelcontextprotocol.io
125
109
  [spec-badge]: https://img.shields.io/badge/spec-spec.modelcontextprotocol.io-blue.svg
126
- [spec-url]: https://modelcontextprotocol.io/specification/latest
110
+ [spec-url]: https://spec.modelcontextprotocol.io
111
+ [discussions-badge]: https://img.shields.io/github/discussions/modelcontextprotocol/python-sdk
112
+ [discussions-url]: https://github.com/modelcontextprotocol/python-sdk/discussions
127
113
 
128
114
  ## Overview
129
115
 
@@ -176,14 +162,14 @@ Let's create a simple MCP server that exposes a calculator tool and some data:
176
162
  """
177
163
  FastMCP quickstart example.
178
164
 
179
- Run from the repository root:
180
- uv run examples/snippets/servers/fastmcp_quickstart.py
165
+ cd to the `examples/snippets/clients` directory and run:
166
+ uv run server fastmcp_quickstart stdio
181
167
  """
182
168
 
183
169
  from mcp.server.fastmcp import FastMCP
184
170
 
185
171
  # Create an MCP server
186
- mcp = FastMCP("Demo", json_response=True)
172
+ mcp = FastMCP("Demo")
187
173
 
188
174
 
189
175
  # Add an addition tool
@@ -211,36 +197,23 @@ def greet_user(name: str, style: str = "friendly") -> str:
211
197
  }
212
198
 
213
199
  return f"{styles.get(style, styles['friendly'])} for someone named {name}."
214
-
215
-
216
- # Run with streamable HTTP transport
217
- if __name__ == "__main__":
218
- mcp.run(transport="streamable-http")
219
200
  ```
220
201
 
221
202
  _Full example: [examples/snippets/servers/fastmcp_quickstart.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/fastmcp_quickstart.py)_
222
203
  <!-- /snippet-source -->
223
204
 
224
- You can install this server in [Claude Code](https://docs.claude.com/en/docs/claude-code/mcp) and interact with it right away. First, run the server:
205
+ You can install this server in [Claude Desktop](https://claude.ai/download) and interact with it right away by running:
225
206
 
226
207
  ```bash
227
- uv run --with mcp examples/snippets/servers/fastmcp_quickstart.py
228
- ```
229
-
230
- Then add it to Claude Code:
231
-
232
- ```bash
233
- claude mcp add --transport http my-server http://localhost:8000/mcp
208
+ uv run mcp install server.py
234
209
  ```
235
210
 
236
- Alternatively, you can test it with the MCP Inspector. Start the server as above, then in a separate terminal:
211
+ Alternatively, you can test it with the MCP Inspector:
237
212
 
238
213
  ```bash
239
- npx -y @modelcontextprotocol/inspector
214
+ uv run mcp dev server.py
240
215
  ```
241
216
 
242
- In the inspector UI, connect to `http://localhost:8000/mcp`.
243
-
244
217
  ## What is MCP?
245
218
 
246
219
  The [Model Context Protocol (MCP)](https://modelcontextprotocol.io) lets you build servers that expose data and functionality to LLM applications in a secure, standardized way. Think of it like a web API, but specifically designed for LLM interactions. MCP servers can:
@@ -440,61 +413,6 @@ causes the tool to be classified as structured _and this is undesirable_,
440
413
  the classification can be suppressed by passing `structured_output=False`
441
414
  to the `@tool` decorator.
442
415
 
443
- ##### Advanced: Direct CallToolResult
444
-
445
- For full control over tool responses including the `_meta` field (for passing data to client applications without exposing it to the model), you can return `CallToolResult` directly:
446
-
447
- <!-- snippet-source examples/snippets/servers/direct_call_tool_result.py -->
448
- ```python
449
- """Example showing direct CallToolResult return for advanced control."""
450
-
451
- from typing import Annotated
452
-
453
- from pydantic import BaseModel
454
-
455
- from mcp.server.fastmcp import FastMCP
456
- from mcp.types import CallToolResult, TextContent
457
-
458
- mcp = FastMCP("CallToolResult Example")
459
-
460
-
461
- class ValidationModel(BaseModel):
462
- """Model for validating structured output."""
463
-
464
- status: str
465
- data: dict[str, int]
466
-
467
-
468
- @mcp.tool()
469
- def advanced_tool() -> CallToolResult:
470
- """Return CallToolResult directly for full control including _meta field."""
471
- return CallToolResult(
472
- content=[TextContent(type="text", text="Response visible to the model")],
473
- _meta={"hidden": "data for client applications only"},
474
- )
475
-
476
-
477
- @mcp.tool()
478
- def validated_tool() -> Annotated[CallToolResult, ValidationModel]:
479
- """Return CallToolResult with structured output validation."""
480
- return CallToolResult(
481
- content=[TextContent(type="text", text="Validated response")],
482
- structuredContent={"status": "success", "data": {"result": 42}},
483
- _meta={"internal": "metadata"},
484
- )
485
-
486
-
487
- @mcp.tool()
488
- def empty_result_tool() -> CallToolResult:
489
- """For empty results, return CallToolResult with empty content."""
490
- return CallToolResult(content=[])
491
- ```
492
-
493
- _Full example: [examples/snippets/servers/direct_call_tool_result.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/direct_call_tool_result.py)_
494
- <!-- /snippet-source -->
495
-
496
- **Important:** `CallToolResult` must always be returned (no `Optional` or `Union`). For empty results, use `CallToolResult(content=[])`. For optional simple types, use `str | None` without `CallToolResult`.
497
-
498
416
  <!-- snippet-source examples/snippets/servers/structured_output.py -->
499
417
  ```python
500
418
  """Example showing structured output with tools."""
@@ -523,7 +441,7 @@ def get_weather(city: str) -> WeatherData:
523
441
  """Get weather for a city - returns structured data."""
524
442
  # Simulated weather data
525
443
  return WeatherData(
526
- temperature=22.5,
444
+ temperature=72.5,
527
445
  humidity=45.0,
528
446
  condition="sunny",
529
447
  wind_speed=5.2,
@@ -628,41 +546,6 @@ def debug_error(error: str) -> list[base.Message]:
628
546
  _Full example: [examples/snippets/servers/basic_prompt.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/basic_prompt.py)_
629
547
  <!-- /snippet-source -->
630
548
 
631
- ### Icons
632
-
633
- MCP servers can provide icons for UI display. Icons can be added to the server implementation, tools, resources, and prompts:
634
-
635
- ```python
636
- from mcp.server.fastmcp import FastMCP, Icon
637
-
638
- # Create an icon from a file path or URL
639
- icon = Icon(
640
- src="icon.png",
641
- mimeType="image/png",
642
- sizes="64x64"
643
- )
644
-
645
- # Add icons to server
646
- mcp = FastMCP(
647
- "My Server",
648
- website_url="https://example.com",
649
- icons=[icon]
650
- )
651
-
652
- # Add icons to tools, resources, and prompts
653
- @mcp.tool(icons=[icon])
654
- def my_tool():
655
- """Tool with an icon."""
656
- return "result"
657
-
658
- @mcp.resource("demo://resource", icons=[icon])
659
- def my_resource():
660
- """Resource with an icon."""
661
- return "content"
662
- ```
663
-
664
- _Full example: [examples/fastmcp/icons_demo.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/fastmcp/icons_demo.py)_
665
-
666
549
  ### Images
667
550
 
668
551
  FastMCP provides an `Image` class that automatically handles image data:
@@ -894,8 +777,6 @@ async def book_table(date: str, time: str, party_size: int, ctx: Context[ServerS
894
777
  _Full example: [examples/snippets/servers/elicitation.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/elicitation.py)_
895
778
  <!-- /snippet-source -->
896
779
 
897
- Elicitation schemas support default values for all field types. Default values are automatically included in the JSON schema sent to clients, allowing them to pre-populate forms.
898
-
899
780
  The `elicit()` method returns an `ElicitationResult` with:
900
781
 
901
782
  - `action`: "accept", "decline", or "cancel"
@@ -1000,7 +881,6 @@ class SimpleTokenVerifier(TokenVerifier):
1000
881
  # Create FastMCP instance as a Resource Server
1001
882
  mcp = FastMCP(
1002
883
  "Weather Service",
1003
- json_response=True,
1004
884
  # Token verifier for authentication
1005
885
  token_verifier=SimpleTokenVerifier(),
1006
886
  # Auth settings for RFC 9728 Protected Resource Metadata
@@ -1046,8 +926,6 @@ The FastMCP server instance accessible via `ctx.fastmcp` provides access to serv
1046
926
 
1047
927
  - `ctx.fastmcp.name` - The server's name as defined during initialization
1048
928
  - `ctx.fastmcp.instructions` - Server instructions/description provided to clients
1049
- - `ctx.fastmcp.website_url` - Optional website URL for the server
1050
- - `ctx.fastmcp.icons` - Optional list of icons for UI display
1051
929
  - `ctx.fastmcp.settings` - Complete server configuration object containing:
1052
930
  - `debug` - Debug mode flag
1053
931
  - `log_level` - Current logging level
@@ -1216,7 +1094,7 @@ Note that `uv run mcp run` or `uv run mcp dev` only supports server using FastMC
1216
1094
 
1217
1095
  ### Streamable HTTP Transport
1218
1096
 
1219
- > **Note**: Streamable HTTP transport is the recommended transport for production deployments. Use `stateless_http=True` and `json_response=True` for optimal scalability.
1097
+ > **Note**: Streamable HTTP transport is superseding SSE transport for production deployments.
1220
1098
 
1221
1099
  <!-- snippet-source examples/snippets/servers/streamable_config.py -->
1222
1100
  ```python
@@ -1227,15 +1105,15 @@ Run from the repository root:
1227
1105
 
1228
1106
  from mcp.server.fastmcp import FastMCP
1229
1107
 
1230
- # Stateless server with JSON responses (recommended)
1231
- mcp = FastMCP("StatelessServer", stateless_http=True, json_response=True)
1108
+ # Stateful server (maintains session state)
1109
+ mcp = FastMCP("StatefulServer")
1232
1110
 
1233
1111
  # Other configuration options:
1234
- # Stateless server with SSE streaming responses
1112
+ # Stateless server (no session persistence)
1235
1113
  # mcp = FastMCP("StatelessServer", stateless_http=True)
1236
1114
 
1237
- # Stateful server with session persistence
1238
- # mcp = FastMCP("StatefulServer")
1115
+ # Stateless server (no session persistence, no sse stream with supported client)
1116
+ # mcp = FastMCP("StatelessServer", stateless_http=True, json_response=True)
1239
1117
 
1240
1118
 
1241
1119
  # Add a simple tool to demonstrate the server
@@ -1270,7 +1148,7 @@ from starlette.routing import Mount
1270
1148
  from mcp.server.fastmcp import FastMCP
1271
1149
 
1272
1150
  # Create the Echo server
1273
- echo_mcp = FastMCP(name="EchoServer", stateless_http=True, json_response=True)
1151
+ echo_mcp = FastMCP(name="EchoServer", stateless_http=True)
1274
1152
 
1275
1153
 
1276
1154
  @echo_mcp.tool()
@@ -1280,7 +1158,7 @@ def echo(message: str) -> str:
1280
1158
 
1281
1159
 
1282
1160
  # Create the Math server
1283
- math_mcp = FastMCP(name="MathServer", stateless_http=True, json_response=True)
1161
+ math_mcp = FastMCP(name="MathServer", stateless_http=True)
1284
1162
 
1285
1163
 
1286
1164
  @math_mcp.tool()
@@ -1381,7 +1259,7 @@ from starlette.routing import Mount
1381
1259
  from mcp.server.fastmcp import FastMCP
1382
1260
 
1383
1261
  # Create MCP server
1384
- mcp = FastMCP("My App", json_response=True)
1262
+ mcp = FastMCP("My App")
1385
1263
 
1386
1264
 
1387
1265
  @mcp.tool()
@@ -1418,7 +1296,7 @@ from starlette.routing import Host
1418
1296
  from mcp.server.fastmcp import FastMCP
1419
1297
 
1420
1298
  # Create MCP server
1421
- mcp = FastMCP("MCP Host App", json_response=True)
1299
+ mcp = FastMCP("MCP Host App")
1422
1300
 
1423
1301
 
1424
1302
  @mcp.tool()
@@ -1455,8 +1333,8 @@ from starlette.routing import Mount
1455
1333
  from mcp.server.fastmcp import FastMCP
1456
1334
 
1457
1335
  # Create multiple MCP servers
1458
- api_mcp = FastMCP("API Server", json_response=True)
1459
- chat_mcp = FastMCP("Chat Server", json_response=True)
1336
+ api_mcp = FastMCP("API Server")
1337
+ chat_mcp = FastMCP("Chat Server")
1460
1338
 
1461
1339
 
1462
1340
  @api_mcp.tool()
@@ -1506,11 +1384,7 @@ from mcp.server.fastmcp import FastMCP
1506
1384
 
1507
1385
  # Configure streamable_http_path during initialization
1508
1386
  # This server will mount at the root of wherever it's mounted
1509
- mcp_at_root = FastMCP(
1510
- "My Server",
1511
- json_response=True,
1512
- streamable_http_path="/",
1513
- )
1387
+ mcp_at_root = FastMCP("My Server", streamable_http_path="/")
1514
1388
 
1515
1389
 
1516
1390
  @mcp_at_root.tool()
@@ -1886,203 +1760,14 @@ if __name__ == "__main__":
1886
1760
  _Full example: [examples/snippets/servers/lowlevel/structured_output.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/lowlevel/structured_output.py)_
1887
1761
  <!-- /snippet-source -->
1888
1762
 
1889
- Tools can return data in four ways:
1763
+ Tools can return data in three ways:
1890
1764
 
1891
1765
  1. **Content only**: Return a list of content blocks (default behavior before spec revision 2025-06-18)
1892
1766
  2. **Structured data only**: Return a dictionary that will be serialized to JSON (Introduced in spec revision 2025-06-18)
1893
1767
  3. **Both**: Return a tuple of (content, structured_data) preferred option to use for backwards compatibility
1894
- 4. **Direct CallToolResult**: Return `CallToolResult` directly for full control (including `_meta` field)
1895
1768
 
1896
1769
  When an `outputSchema` is defined, the server automatically validates the structured output against the schema. This ensures type safety and helps catch errors early.
1897
1770
 
1898
- ##### Returning CallToolResult Directly
1899
-
1900
- For full control over the response including the `_meta` field (for passing data to client applications without exposing it to the model), return `CallToolResult` directly:
1901
-
1902
- <!-- snippet-source examples/snippets/servers/lowlevel/direct_call_tool_result.py -->
1903
- ```python
1904
- """
1905
- Run from the repository root:
1906
- uv run examples/snippets/servers/lowlevel/direct_call_tool_result.py
1907
- """
1908
-
1909
- import asyncio
1910
- from typing import Any
1911
-
1912
- import mcp.server.stdio
1913
- import mcp.types as types
1914
- from mcp.server.lowlevel import NotificationOptions, Server
1915
- from mcp.server.models import InitializationOptions
1916
-
1917
- server = Server("example-server")
1918
-
1919
-
1920
- @server.list_tools()
1921
- async def list_tools() -> list[types.Tool]:
1922
- """List available tools."""
1923
- return [
1924
- types.Tool(
1925
- name="advanced_tool",
1926
- description="Tool with full control including _meta field",
1927
- inputSchema={
1928
- "type": "object",
1929
- "properties": {"message": {"type": "string"}},
1930
- "required": ["message"],
1931
- },
1932
- )
1933
- ]
1934
-
1935
-
1936
- @server.call_tool()
1937
- async def handle_call_tool(name: str, arguments: dict[str, Any]) -> types.CallToolResult:
1938
- """Handle tool calls by returning CallToolResult directly."""
1939
- if name == "advanced_tool":
1940
- message = str(arguments.get("message", ""))
1941
- return types.CallToolResult(
1942
- content=[types.TextContent(type="text", text=f"Processed: {message}")],
1943
- structuredContent={"result": "success", "message": message},
1944
- _meta={"hidden": "data for client applications only"},
1945
- )
1946
-
1947
- raise ValueError(f"Unknown tool: {name}")
1948
-
1949
-
1950
- async def run():
1951
- """Run the server."""
1952
- async with mcp.server.stdio.stdio_server() as (read_stream, write_stream):
1953
- await server.run(
1954
- read_stream,
1955
- write_stream,
1956
- InitializationOptions(
1957
- server_name="example",
1958
- server_version="0.1.0",
1959
- capabilities=server.get_capabilities(
1960
- notification_options=NotificationOptions(),
1961
- experimental_capabilities={},
1962
- ),
1963
- ),
1964
- )
1965
-
1966
-
1967
- if __name__ == "__main__":
1968
- asyncio.run(run())
1969
- ```
1970
-
1971
- _Full example: [examples/snippets/servers/lowlevel/direct_call_tool_result.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/lowlevel/direct_call_tool_result.py)_
1972
- <!-- /snippet-source -->
1973
-
1974
- **Note:** When returning `CallToolResult`, you bypass the automatic content/structured conversion. You must construct the complete response yourself.
1975
-
1976
- ### Pagination (Advanced)
1977
-
1978
- For servers that need to handle large datasets, the low-level server provides paginated versions of list operations. This is an optional optimization - most servers won't need pagination unless they're dealing with hundreds or thousands of items.
1979
-
1980
- #### Server-side Implementation
1981
-
1982
- <!-- snippet-source examples/snippets/servers/pagination_example.py -->
1983
- ```python
1984
- """
1985
- Example of implementing pagination with MCP server decorators.
1986
- """
1987
-
1988
- from pydantic import AnyUrl
1989
-
1990
- import mcp.types as types
1991
- from mcp.server.lowlevel import Server
1992
-
1993
- # Initialize the server
1994
- server = Server("paginated-server")
1995
-
1996
- # Sample data to paginate
1997
- ITEMS = [f"Item {i}" for i in range(1, 101)] # 100 items
1998
-
1999
-
2000
- @server.list_resources()
2001
- async def list_resources_paginated(request: types.ListResourcesRequest) -> types.ListResourcesResult:
2002
- """List resources with pagination support."""
2003
- page_size = 10
2004
-
2005
- # Extract cursor from request params
2006
- cursor = request.params.cursor if request.params is not None else None
2007
-
2008
- # Parse cursor to get offset
2009
- start = 0 if cursor is None else int(cursor)
2010
- end = start + page_size
2011
-
2012
- # Get page of resources
2013
- page_items = [
2014
- types.Resource(uri=AnyUrl(f"resource://items/{item}"), name=item, description=f"Description for {item}")
2015
- for item in ITEMS[start:end]
2016
- ]
2017
-
2018
- # Determine next cursor
2019
- next_cursor = str(end) if end < len(ITEMS) else None
2020
-
2021
- return types.ListResourcesResult(resources=page_items, nextCursor=next_cursor)
2022
- ```
2023
-
2024
- _Full example: [examples/snippets/servers/pagination_example.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/servers/pagination_example.py)_
2025
- <!-- /snippet-source -->
2026
-
2027
- #### Client-side Consumption
2028
-
2029
- <!-- snippet-source examples/snippets/clients/pagination_client.py -->
2030
- ```python
2031
- """
2032
- Example of consuming paginated MCP endpoints from a client.
2033
- """
2034
-
2035
- import asyncio
2036
-
2037
- from mcp.client.session import ClientSession
2038
- from mcp.client.stdio import StdioServerParameters, stdio_client
2039
- from mcp.types import PaginatedRequestParams, Resource
2040
-
2041
-
2042
- async def list_all_resources() -> None:
2043
- """Fetch all resources using pagination."""
2044
- async with stdio_client(StdioServerParameters(command="uv", args=["run", "mcp-simple-pagination"])) as (
2045
- read,
2046
- write,
2047
- ):
2048
- async with ClientSession(read, write) as session:
2049
- await session.initialize()
2050
-
2051
- all_resources: list[Resource] = []
2052
- cursor = None
2053
-
2054
- while True:
2055
- # Fetch a page of resources
2056
- result = await session.list_resources(params=PaginatedRequestParams(cursor=cursor))
2057
- all_resources.extend(result.resources)
2058
-
2059
- print(f"Fetched {len(result.resources)} resources")
2060
-
2061
- # Check if there are more pages
2062
- if result.nextCursor:
2063
- cursor = result.nextCursor
2064
- else:
2065
- break
2066
-
2067
- print(f"Total resources: {len(all_resources)}")
2068
-
2069
-
2070
- if __name__ == "__main__":
2071
- asyncio.run(list_all_resources())
2072
- ```
2073
-
2074
- _Full example: [examples/snippets/clients/pagination_client.py](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/snippets/clients/pagination_client.py)_
2075
- <!-- /snippet-source -->
2076
-
2077
- #### Key Points
2078
-
2079
- - **Cursors are opaque strings** - the server defines the format (numeric offsets, timestamps, etc.)
2080
- - **Return `nextCursor=None`** when there are no more pages
2081
- - **Backward compatible** - clients that don't support pagination will still work (they'll just get the first page)
2082
- - **Flexible page sizes** - Each endpoint can define its own page size based on data characteristics
2083
-
2084
- See the [simple-pagination example](examples/servers/simple-pagination) for a complete implementation.
2085
-
2086
1771
  ### Writing MCP Clients
2087
1772
 
2088
1773
  The SDK provides a high-level client interface for connecting to MCP servers using various [transports](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports):
@@ -2493,9 +2178,8 @@ MCP servers declare capabilities during initialization:
2493
2178
 
2494
2179
  ## Documentation
2495
2180
 
2496
- - [API Reference](https://modelcontextprotocol.github.io/python-sdk/api/)
2497
2181
  - [Model Context Protocol documentation](https://modelcontextprotocol.io)
2498
- - [Model Context Protocol specification](https://modelcontextprotocol.io/specification/latest)
2182
+ - [Model Context Protocol specification](https://spec.modelcontextprotocol.io)
2499
2183
  - [Officially supported servers](https://github.com/modelcontextprotocol/servers)
2500
2184
 
2501
2185
  ## Contributing