pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/modelcontextprotocol/python-sdk/commit/ed87ae9f06e0bed6eb65d4de5917b42fd754fe50

a="all" rel="stylesheet" href="https://github.githubassets.com/assets/global-7a1ad343bd40328c.css" /> rename mcp_python to mcp · modelcontextprotocol/python-sdk@ed87ae9 · GitHub
Skip to content

Commit ed87ae9

Browse files
committed
rename mcp_python to mcp
1 parent aa164ab commit ed87ae9

31 files changed

Lines changed: 130 additions & 129 deletions

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "mcp-python"
6+
name = "mcp"
77
version = "0.7.0.dev"
88
description = "Model Context Protocol implementation for Python"
99
readme = "README.md"
@@ -18,10 +18,10 @@ dependencies = [
1818
]
1919

2020
[tool.hatch.build.targets.wheel]
21-
packages = ["mcp_python"]
21+
packages = ["src/mcp"]
2222

2323
[tool.pyright]
24-
include = ["mcp_python", "tests"]
24+
include = ["src/mcp", "tests"]
2525
venvPath = "."
2626
venv = ".venv"
2727

@@ -31,14 +31,14 @@ ignore = []
3131

3232
[tool.ruff]
3333
line-length = 88
34-
target-version = "py38"
34+
target-version = "py310"
3535

3636
[tool.ruff.lint.per-file-ignores]
3737
"__init__.py" = ["F401"]
3838

3939
[tool.uv]
4040
dev-dependencies = [
41-
"pyright>=1.1.384",
41+
"pyright>=1.1.378",
4242
"pytest>=8.3.3",
4343
"ruff>=0.6.9",
4444
"trio>=0.26.2",
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
import anyio
77
import click
88

9-
from mcp_python.client.session import ClientSession
10-
from mcp_python.client.sse import sse_client
11-
from mcp_python.client.stdio import StdioServerParameters, stdio_client
9+
from mcp.client.session import ClientSession
10+
from mcp.client.sse import sse_client
11+
from mcp.client.stdio import StdioServerParameters, stdio_client
1212

1313
if not sys.warnoptions:
1414
import warnings
Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
44
from pydantic import AnyUrl
55

6-
from mcp_python.shared.session import BaseSession
7-
from mcp_python.shared.version import SUPPORTED_PROTOCOL_VERSIONS
8-
from mcp_python.types import (
6+
from mcp.shared.session import BaseSession
7+
from mcp.shared.version import SUPPORTED_PROTOCOL_VERSIONS
8+
from mcp.types import (
99
LATEST_PROTOCOL_VERSION,
1010
CallToolResult,
1111
ClientCapabilities,
@@ -56,7 +56,7 @@ def __init__(
5656
)
5757

5858
async def initialize(self) -> InitializeResult:
59-
from mcp_python.types import (
59+
from mcp.types import (
6060
InitializeRequest,
6161
InitializeRequestParams,
6262
)
@@ -77,7 +77,7 @@ async def initialize(self) -> InitializeResult:
7777
listChanged=True
7878
),
7979
),
80-
clientInfo=Implementation(name="mcp_python", version="0.1.0"),
80+
clientInfo=Implementation(name="mcp", version="0.1.0"),
8181
),
8282
)
8383
),
@@ -100,7 +100,7 @@ async def initialize(self) -> InitializeResult:
100100

101101
async def send_ping(self) -> EmptyResult:
102102
"""Send a ping request."""
103-
from mcp_python.types import PingRequest
103+
from mcp.types import PingRequest
104104

105105
return await self.send_request(
106106
ClientRequest(
@@ -115,7 +115,7 @@ async def send_progress_notification(
115115
self, progress_token: str | int, progress: float, total: float | None = None
116116
) -> None:
117117
"""Send a progress notification."""
118-
from mcp_python.types import (
118+
from mcp.types import (
119119
ProgressNotification,
120120
ProgressNotificationParams,
121121
)
@@ -135,7 +135,7 @@ async def send_progress_notification(
135135

136136
async def set_logging_level(self, level: LoggingLevel) -> EmptyResult:
137137
"""Send a logging/setLevel request."""
138-
from mcp_python.types import (
138+
from mcp.types import (
139139
SetLevelRequest,
140140
SetLevelRequestParams,
141141
)
@@ -152,7 +152,7 @@ async def set_logging_level(self, level: LoggingLevel) -> EmptyResult:
152152

153153
async def list_resources(self) -> ListResourcesResult:
154154
"""Send a resources/list request."""
155-
from mcp_python.types import (
155+
from mcp.types import (
156156
ListResourcesRequest,
157157
)
158158

@@ -167,7 +167,7 @@ async def list_resources(self) -> ListResourcesResult:
167167

168168
async def read_resource(self, uri: AnyUrl) -> ReadResourceResult:
169169
"""Send a resources/read request."""
170-
from mcp_python.types import (
170+
from mcp.types import (
171171
ReadResourceRequest,
172172
ReadResourceRequestParams,
173173
)
@@ -184,7 +184,7 @@ async def read_resource(self, uri: AnyUrl) -> ReadResourceResult:
184184

185185
async def subscribe_resource(self, uri: AnyUrl) -> EmptyResult:
186186
"""Send a resources/subscribe request."""
187-
from mcp_python.types import (
187+
from mcp.types import (
188188
SubscribeRequest,
189189
SubscribeRequestParams,
190190
)
@@ -201,7 +201,7 @@ async def subscribe_resource(self, uri: AnyUrl) -> EmptyResult:
201201

202202
async def unsubscribe_resource(self, uri: AnyUrl) -> EmptyResult:
203203
"""Send a resources/unsubscribe request."""
204-
from mcp_python.types import (
204+
from mcp.types import (
205205
UnsubscribeRequest,
206206
UnsubscribeRequestParams,
207207
)
@@ -220,7 +220,7 @@ async def call_tool(
220220
self, name: str, arguments: dict | None = None
221221
) -> CallToolResult:
222222
"""Send a tools/call request."""
223-
from mcp_python.types import (
223+
from mcp.types import (
224224
CallToolRequest,
225225
CallToolRequestParams,
226226
)
@@ -237,7 +237,7 @@ async def call_tool(
237237

238238
async def list_prompts(self) -> ListPromptsResult:
239239
"""Send a prompts/list request."""
240-
from mcp_python.types import ListPromptsRequest
240+
from mcp.types import ListPromptsRequest
241241

242242
return await self.send_request(
243243
ClientRequest(
@@ -252,7 +252,7 @@ async def get_prompt(
252252
self, name: str, arguments: dict[str, str] | None = None
253253
) -> GetPromptResult:
254254
"""Send a prompts/get request."""
255-
from mcp_python.types import GetPromptRequest, GetPromptRequestParams
255+
from mcp.types import GetPromptRequest, GetPromptRequestParams
256256

257257
return await self.send_request(
258258
ClientRequest(
@@ -268,7 +268,7 @@ async def complete(
268268
self, ref: ResourceReference | PromptReference, argument: dict
269269
) -> CompleteResult:
270270
"""Send a completion/complete request."""
271-
from mcp_python.types import (
271+
from mcp.types import (
272272
CompleteRequest,
273273
CompleteRequestParams,
274274
CompletionArgument,
@@ -289,7 +289,7 @@ async def complete(
289289

290290
async def list_tools(self) -> ListToolsResult:
291291
"""Send a tools/list request."""
292-
from mcp_python.types import ListToolsRequest
292+
from mcp.types import ListToolsRequest
293293

294294
return await self.send_request(
295295
ClientRequest(
@@ -302,7 +302,7 @@ async def list_tools(self) -> ListToolsResult:
302302

303303
async def send_roots_list_changed(self) -> None:
304304
"""Send a roots/list_changed notification."""
305-
from mcp_python.types import RootsListChangedNotification
305+
from mcp.types import RootsListChangedNotification
306306

307307
await self.send_notification(
308308
ClientNotification(
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
1010
from httpx_sse import aconnect_sse
1111

12-
from mcp_python.types import JSONRPCMessage
12+
from mcp.types import JSONRPCMessage
1313

1414
logger = logging.getLogger(__name__)
1515

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from anyio.streams.text import TextReceiveStream
99
from pydantic import BaseModel, Field
1010

11-
from mcp_python.types import JSONRPCMessage
11+
from mcp.types import JSONRPCMessage
1212

1313
# Environment variables to inherit by default
1414
DEFAULT_INHERITED_ENV_VARS = (
File renamed without changes.
Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
88
from pydantic import AnyUrl
99

10-
from mcp_python.server import types
11-
from mcp_python.server.session import ServerSession
12-
from mcp_python.server.stdio import stdio_server as stdio_server
13-
from mcp_python.shared.context import RequestContext
14-
from mcp_python.shared.session import RequestResponder
15-
from mcp_python.types import (
10+
from mcp.server import types
11+
from mcp.server.session import ServerSession
12+
from mcp.server.stdio import stdio_server as stdio_server
13+
from mcp.shared.context import RequestContext
14+
from mcp.shared.session import RequestResponder
15+
from mcp.types import (
1616
METHOD_NOT_FOUND,
1717
CallToolRequest,
1818
ClientNotification,
@@ -101,7 +101,7 @@ def pkg_version(package: str) -> str:
101101

102102
return types.InitializationOptions(
103103
server_name=self.name,
104-
server_version=pkg_version("mcp_python"),
104+
server_version=pkg_version("mcp"),
105105
capabilities=self.get_capabilities(
106106
notification_options or NotificationOptions(),
107107
experimental_capabilities or {},
@@ -168,12 +168,12 @@ async def handler(_: Any):
168168
return decorator
169169

170170
def get_prompt(self):
171-
from mcp_python.types import (
171+
from mcp.types import (
172172
GetPromptRequest,
173173
GetPromptResult,
174174
ImageContent,
175175
)
176-
from mcp_python.types import (
176+
from mcp.types import (
177177
Role as Role,
178178
)
179179

@@ -232,7 +232,7 @@ async def handler(_: Any):
232232
return decorator
233233

234234
def read_resource(self):
235-
from mcp_python.types import (
235+
from mcp.types import (
236236
BlobResourceContents,
237237
TextResourceContents,
238238
)
@@ -270,7 +270,7 @@ async def handler(req: ReadResourceRequest):
270270
return decorator
271271

272272
def set_logging_level(self):
273-
from mcp_python.types import EmptyResult
273+
from mcp.types import EmptyResult
274274

275275
def decorator(func: Callable[[LoggingLevel], Awaitable[None]]):
276276
logger.debug("Registering handler for SetLevelRequest")
@@ -285,7 +285,7 @@ async def handler(req: SetLevelRequest):
285285
return decorator
286286

287287
def subscribe_resource(self):
288-
from mcp_python.types import EmptyResult
288+
from mcp.types import EmptyResult
289289

290290
def decorator(func: Callable[[AnyUrl], Awaitable[None]]):
291291
logger.debug("Registering handler for SubscribeRequest")
@@ -300,7 +300,7 @@ async def handler(req: SubscribeRequest):
300300
return decorator
301301

302302
def unsubscribe_resource(self):
303-
from mcp_python.types import EmptyResult
303+
from mcp.types import EmptyResult
304304

305305
def decorator(func: Callable[[AnyUrl], Awaitable[None]]):
306306
logger.debug("Registering handler for UnsubscribeRequest")
@@ -328,7 +328,7 @@ async def handler(_: Any):
328328
return decorator
329329

330330
def call_tool(self):
331-
from mcp_python.types import (
331+
from mcp.types import (
332332
CallToolResult,
333333
EmbeddedResource,
334334
ImageContent,
@@ -337,7 +337,8 @@ def call_tool(self):
337337

338338
def decorator(
339339
func: Callable[
340-
..., Awaitable[Sequence[str | types.ImageContent | types.EmbeddedResource]]
340+
...,
341+
Awaitable[Sequence[str | types.ImageContent | types.EmbeddedResource]],
341342
],
342343
):
343344
logger.debug("Registering handler for CallToolRequest")
@@ -397,7 +398,7 @@ async def handler(req: ProgressNotification):
397398

398399
def completion(self):
399400
"""Provides completions for prompts and resource templates"""
400-
from mcp_python.types import CompleteResult, Completion, CompletionArgument
401+
from mcp.types import CompleteResult, Completion, CompletionArgument
401402

402403
def decorator(
403404
func: Callable[
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
import anyio
66

7-
from mcp_python.server.session import ServerSession
8-
from mcp_python.server.stdio import stdio_server
9-
from mcp_python.server.types import InitializationOptions
10-
from mcp_python.types import ServerCapabilities
7+
from mcp.server.session import ServerSession
8+
from mcp.server.stdio import stdio_server
9+
from mcp.server.types import InitializationOptions
10+
from mcp.types import ServerCapabilities
1111

1212
if not sys.warnoptions:
1313
import warnings
@@ -29,14 +29,14 @@ async def receive_loop(session: ServerSession):
2929

3030

3131
async def main():
32-
version = importlib.metadata.version("mcp_python")
32+
version = importlib.metadata.version("mcp")
3333
async with stdio_server() as (read_stream, write_stream):
3434
async with (
3535
ServerSession(
3636
read_stream,
3737
write_stream,
3838
InitializationOptions(
39-
server_name="mcp_python",
39+
server_name="mcp",
4040
server_version=version,
4141
capabilities=ServerCapabilities(),
4242
),

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy