Skip to content

Commit c143aa9

Browse files
agu-zbennetbo
andauthored
Support HTTP/SSE in MCP Server configuration types (agentclientprotocol#75)
* Support HTTP/SSE in MCP Server configuration objects Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de> * Remove unnecessary comment * Remove unnecessary comment * Update docs --------- Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
1 parent b5db4c0 commit c143aa9

9 files changed

Lines changed: 742 additions & 53 deletions

File tree

Cargo.lock

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,4 @@ futures-util = { version = "0.3", features = ["io"] }
5858
async-pipe = { git = "https://github.com/zed-industries/async-pipe-rs", rev = "82d00a04211cf4e1236029aa03e6b6ce2a74c553" }
5959
env_logger = "0.11"
6060
rustyline = "17.0.1"
61+
pretty_assertions = "1.4.1"

docs/protocol/initialization.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,19 @@ Optionally, they **MAY** support richer types of [content](./content) by specify
141141
The prompt may include `ContentBlock::Resource`
142142
</ResponseField>
143143

144+
#### MCP capabilities
145+
146+
<ResponseField name="http" type="boolean" post={["default: false"]}>
147+
The Agent supports connecting to MCP servers over HTTP.
148+
</ResponseField>
149+
150+
<ResponseField name="sse" type="boolean" post={["default: false"]}>
151+
The Agent supports connecting to MCP servers over SSE.
152+
153+
Note: This transport has been deprecated by the MCP spec.
154+
155+
</ResponseField>
156+
144157
---
145158

146159
Once the connection is initialized, you're ready to [create a session](./session-setup) and begin the conversation with the Agent.

docs/protocol/schema.mdx

Lines changed: 118 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ See protocol docs: [Initialization](https://agentclientprotocol.com/protocol/ini
9292
<ResponseField name="agentCapabilities" type={<a href="#agentcapabilities">AgentCapabilities</a>} >
9393
Capabilities supported by the agent.
9494

95-
- Default: `{"loadSession":false,"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}`
95+
- Default: `{"loadSession":false,"mcpCapabilities":{"http":false,"sse":false},"promptCapabilities":{"audio":false,"embeddedContext":false,"image":false}}`
9696

9797
</ResponseField>
9898
<ResponseField name="authMethods" type={<><span><a href="#authmethod">AuthMethod</a></span><span>[]</span></>} >
@@ -162,7 +162,7 @@ See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/s
162162

163163
Request parameters for loading an existing session.
164164

165-
Only available if the agent supports the `loadSession` capability.
165+
Only available if the Agent supports the `loadSession` capability.
166166

167167
See protocol docs: [Loading Sessions](https://agentclientprotocol.com/protocol/session-setup#loading-sessions)
168168

@@ -535,6 +535,12 @@ See protocol docs: [Agent Capabilities](https://agentclientprotocol.com/protocol
535535

536536
- Default: `false`
537537

538+
</ResponseField>
539+
<ResponseField name="mcpCapabilities" type={<a href="#mcpcapabilities">McpCapabilities</a>} >
540+
MCP capabilities supported by the agent.
541+
542+
- Default: `{"http":false,"sse":false}`
543+
538544
</ResponseField>
539545
<ResponseField name="promptCapabilities" type={<a href="#promptcapabilities">PromptCapabilities</a>} >
540546
Prompt capabilities supported by the agent.
@@ -937,6 +943,21 @@ See protocol docs: [FileSystem](https://agentclientprotocol.com/protocol/initial
937943

938944
</ResponseField>
939945

946+
## <span class="font-mono">HttpHeader</span>
947+
948+
An HTTP header to set when making requests to the MCP server.
949+
950+
**Type:** Object
951+
952+
**Properties:**
953+
954+
<ResponseField name="name" type={"string"} required>
955+
The name of the HTTP header.
956+
</ResponseField>
957+
<ResponseField name="value" type={"string"} required>
958+
The value to set for the HTTP header.
959+
</ResponseField>
960+
940961
## <span class="font-mono">ImageContent</span>
941962

942963
An image provided to or from an LLM.
@@ -960,6 +981,27 @@ An image provided to or from an LLM.
960981
<ResponseField name="mimeType" type={"string"} required></ResponseField>
961982
<ResponseField name="uri" type={"string | null"}></ResponseField>
962983

984+
## <span class="font-mono">McpCapabilities</span>
985+
986+
MCP capabilities supported by the agent
987+
988+
**Type:** Object
989+
990+
**Properties:**
991+
992+
<ResponseField name="http" type={"boolean"} >
993+
Agent supports `McpServer::Http`.
994+
995+
- Default: `false`
996+
997+
</ResponseField>
998+
<ResponseField name="sse" type={"boolean"} >
999+
Agent supports `McpServer::Sse`.
1000+
1001+
- Default: `false`
1002+
1003+
</ResponseField>
1004+
9631005
## <span class="font-mono">McpServer</span>
9641006

9651007
Configuration for connecting to an MCP (Model Context Protocol) server.
@@ -969,9 +1011,78 @@ processing prompts.
9691011

9701012
See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/session-setup#mcp-servers)
9711013

972-
**Type:** Object
1014+
**Type:** Union
9731015

974-
**Properties:**
1016+
<ResponseField name="http">
1017+
HTTP transport configuration
1018+
1019+
Only available when the Agent capabilities indicate `mcp_capabilities.http` is `true`.
1020+
1021+
<Expandable title="Properties">
1022+
1023+
<ResponseField
1024+
name="headers"
1025+
type={
1026+
<>
1027+
<span>
1028+
<a href="#httpheader">HttpHeader</a>
1029+
</span>
1030+
<span>[]</span>
1031+
</>
1032+
}
1033+
required
1034+
>
1035+
HTTP headers to set when making requests to the MCP server.
1036+
</ResponseField>
1037+
<ResponseField name="name" type={"string"} required>
1038+
Human-readable name identifying this MCP server.
1039+
</ResponseField>
1040+
<ResponseField name="type" type={"string"} required></ResponseField>
1041+
<ResponseField name="url" type={"string"} required>
1042+
URL to the MCP server.
1043+
</ResponseField>
1044+
1045+
</Expandable>
1046+
</ResponseField>
1047+
1048+
<ResponseField name="sse">
1049+
SSE transport configuration
1050+
1051+
Only available when the Agent capabilities indicate `mcp_capabilities.sse` is `true`.
1052+
1053+
<Expandable title="Properties">
1054+
1055+
<ResponseField
1056+
name="headers"
1057+
type={
1058+
<>
1059+
<span>
1060+
<a href="#httpheader">HttpHeader</a>
1061+
</span>
1062+
<span>[]</span>
1063+
</>
1064+
}
1065+
required
1066+
>
1067+
HTTP headers to set when making requests to the MCP server.
1068+
</ResponseField>
1069+
<ResponseField name="name" type={"string"} required>
1070+
Human-readable name identifying this MCP server.
1071+
</ResponseField>
1072+
<ResponseField name="type" type={"string"} required></ResponseField>
1073+
<ResponseField name="url" type={"string"} required>
1074+
URL to the MCP server.
1075+
</ResponseField>
1076+
1077+
</Expandable>
1078+
</ResponseField>
1079+
1080+
<ResponseField name="Object">
1081+
Stdio transport configuration
1082+
1083+
All Agents MUST support this transport.
1084+
1085+
<Expandable title="Properties">
9751086

9761087
<ResponseField
9771088
name="args"
@@ -1006,6 +1117,9 @@ See protocol docs: [MCP Servers](https://agentclientprotocol.com/protocol/sessio
10061117
Human-readable name identifying this MCP server.
10071118
</ResponseField>
10081119

1120+
</Expandable>
1121+
</ResponseField>
1122+
10091123
## <span class="font-mono">PermissionOption</span>
10101124

10111125
An option presented to the user when requesting permission.

0 commit comments

Comments
 (0)