Commit Graph

96 Commits

Author SHA1 Message Date
David Soria Parra
8668a04211 v0.8.0 2024-11-13 14:44:48 +00:00
David Soria Parra
057130f13f Merge pull request #50 from modelcontextprotocol/davidsp/python
pin to lowest supported python version
2024-11-13 10:48:11 +00:00
David Soria Parra
f00559a465 pin to lowest supported python version 2024-11-13 10:44:54 +00:00
David Soria Parra
8ab02572fd Merge pull request #49 from modelcontextprotocol/davidsp/simple-resource
add simple resource example
2024-11-12 15:14:43 +00:00
David Soria Parra
e1766443b8 add simple resource example 2024-11-12 14:29:14 +00:00
David Soria Parra
b1d41bb7df Merge pull request #48 from modelcontextprotocol/davidsp/example
Example server to expose a fetch tool
2024-11-12 13:54:03 +00:00
David Soria Parra
10881fb19b Example server to expose a fetch tool and a fetch prompt 2024-11-12 13:53:36 +00:00
David Soria Parra
3d670a3b92 Merge pull request #46 from modelcontextprotocol/test-release
PyPI release workflow
2024-11-12 11:36:46 +00:00
David Soria Parra
753c76e479 PyPI release workflow 2024-11-12 11:32:13 +00:00
David Soria Parra
bb3894a630 Merge pull request #45 from modelcontextprotocol/davidsp/client-capabilities
feat: add client capability checking to ServerSession
2024-11-11 22:48:28 +00:00
David Soria Parra
76a0b80c4c feat: add client capability checking to ServerSession
Add methods to track and verify client capabilities during initialization. This
includes storing client parameters from the initialize request and providing a
check_client_capability method to verify if specific capabilities are supported
by the connected client.
2024-11-11 21:53:34 +00:00
David Soria Parra
df33a9b71c Merge pull request #44 from modelcontextprotocol/davidsp/bump
bump
2024-11-11 21:20:33 +00:00
David Soria Parra
41a6157aee Merge pull request #43 from modelcontextprotocol/davidsp/request_context
Return a specific server session instance of request context
2024-11-11 21:19:24 +00:00
David Soria Parra
5506abd153 bump 2024-11-11 21:11:42 +00:00
David Soria Parra
1177a11910 Return a specific server session instance of request context
We currently return a generic instance of RequestContext without
a specialization on the Session type. This makes it impossible
for servers to typesafe call `list_roots()` and other methods.

We now return a specific instance of `RequestContext[ServerSession]`
2024-11-11 21:11:13 +00:00
David Soria Parra
99c402d575 Merge pull request #42 from modelcontextprotocol/davidsp/types
Types Rework
2024-11-11 21:02:43 +00:00
David Soria Parra
ec8c85edea run ruff 2024-11-11 20:42:46 +00:00
David Soria Parra
b9b44e6dad Don't re-export types
We will be a bit more low level and expect callees to import mcp.types
instead of relying in re-exported types. This makes usage more explicit
and avoids potential collisions in mcp.server.
2024-11-11 20:39:33 +00:00
David Soria Parra
f5d82bd229 Remove helper types
The helper types in mcp.server.types got really confusioning during
implementation as they overlapped with mcp.types. I now believe it
is better if we stay more low level to the spec types.

To do this, we now only use mcp.types everywhere. We renamed mcp.server.types
to mcp.server.models and removed it to the absolute minimum.
2024-11-11 20:05:51 +00:00
David Soria Parra
837309c3c8 Merge pull request #41 from modelcontextprotocol/davidsp/readme
update package name in readme
2024-11-11 16:50:38 +00:00
David Soria Parra
500f48d1ad update package name in readme 2024-11-11 16:22:26 +00:00
David Soria Parra
01e8040428 Merge pull request #39 from modelcontextprotocol/davidsp/pyproject
update pyproject toml
2024-11-11 16:10:12 +00:00
Justin Spahr-Summers
25a930901e Merge pull request #40 from modelcontextprotocol/jspahrsummers-patch-1
Update README title
2024-11-11 16:07:18 +00:00
Justin Spahr-Summers
f2f324cd5b Update README title 2024-11-11 16:00:48 +00:00
David Soria Parra
b47924f42d update pyproject toml 2024-11-11 15:40:11 +00:00
David Soria Parra
dfe42131f6 Merge pull request #38 from modelcontextprotocol/davidsp/mcp
rename mcp_python to mcp
2024-11-11 15:11:51 +00:00
David Soria Parra
ed87ae9f06 rename mcp_python to mcp 2024-11-11 12:40:32 +00:00
David Soria Parra
aa164ab556 Merge branch 'v0.6.x' 2024-11-10 23:55:17 +00:00
David Soria Parra
586b495f22 Merge pull request #37 from modelcontextprotocol/davidsp/bump
bump version
2024-11-10 23:54:52 +00:00
David Soria Parra
34ffcf4e43 bump version 2024-11-10 23:53:55 +00:00
David Soria Parra
aec2ca5270 v0.6.1 2024-11-10 23:50:55 +00:00
David Soria Parra
935fe5d1a0 Make call_tool() return value covariant
`list` is invariant, hence handlers can't just return `list[str]`.
We need to use Sequence here.
2024-11-10 21:47:26 +00:00
David Soria Parra
74c49c2906 Bump v0.6.0 2024-11-10 21:45:23 +00:00
David Soria Parra
4eae68d67e Merge pull request #33 from modelcontextprotocol/davidsp/license
Add LICENSE file
2024-11-07 16:58:26 +00:00
David Soria Parra
d0b055dfc8 Merge pull request #32 from modelcontextprotocol/davidsp/readme
Add README
2024-11-07 16:58:14 +00:00
David Soria Parra
551eadb603 Add LICENSE file 2024-11-07 14:59:39 +00:00
David Soria Parra
e94bf7fbba Add README 2024-11-07 14:57:56 +00:00
David Soria Parra
b0787fd147 Merge pull request #30 from modelcontextprotocol/davidsp/capabilities
feat: add structured capability types
2024-11-07 14:51:20 +00:00
David Soria Parra
5497da0afd feat: add structured capability types
Replace generic capability dictionaries with structured types for prompts,
resources, tools, and roots. This improves type safety and makes capability
features like listChanged and subscribe more explicit in the protocol.
2024-11-07 14:49:40 +00:00
David Soria Parra
14addfb872 Merge pull request #26 from modelcontextprotocol/bump-main-branch-to-0.6.0.dev
bump main branch to 0.6.0.dev
2024-11-07 14:16:31 +00:00
Justin Spahr-Summers
975f79b119 Merge pull request #31 from modelcontextprotocol/justin/is-error-optional
`CallToolResult.isError` should be optional
2024-11-07 13:39:15 +00:00
Justin Spahr-Summers
405fb3e18c CallToolResult.isError should be optional 2024-11-07 13:38:01 +00:00
Justin Spahr-Summers
5587c0276c Merge pull request #28 from modelcontextprotocol/justin/spec-updates
Update to spec version 2024-11-05
2024-11-07 11:45:36 +00:00
Justin Spahr-Summers
48beb52ffd Merge pull request #27 from modelcontextprotocol/justin/env-var-inheritance
Inherit environment variables deemed safe by default
2024-11-07 11:11:27 +00:00
Justin Spahr-Summers
c7d8f11e0c Formatting 2024-11-06 12:35:32 +00:00
Justin Spahr-Summers
a891ad4689 Update tool calls to use structured results 2024-11-06 12:33:50 +00:00
Justin Spahr-Summers
185a186215 Rename request_create_message for consistency 2024-11-06 12:25:09 +00:00
Justin Spahr-Summers
4ac03d40f9 Update convenience methods on ClientSession and ServerSession 2024-11-06 12:24:53 +00:00
Justin Spahr-Summers
1634343931 Update types for spec changes 2024-11-06 12:24:46 +00:00
Justin Spahr-Summers
df901f698d Manually fix ruff issue 2024-11-06 11:08:22 +00:00