feat(core): add mcp support (#34513)
This commit is contained in:
parent
12887e572e
commit
b1ca070b3b
30 changed files with 1966 additions and 388 deletions
22
packages/protocol/src/groups/mcp.ts
Normal file
22
packages/protocol/src/groups/mcp.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { Mcp } from "@opencode-ai/schema/mcp"
|
||||
import { Location } from "@opencode-ai/schema/location"
|
||||
import { Schema } from "effect"
|
||||
import { HttpApiEndpoint, HttpApiGroup, OpenApi } from "effect/unstable/httpapi"
|
||||
import { LocationQuery, locationQueryOpenApi } from "./location"
|
||||
|
||||
export const McpGroup = HttpApiGroup.make("server.mcp")
|
||||
.add(
|
||||
HttpApiEndpoint.get("mcp.list", "/api/mcp", {
|
||||
query: LocationQuery,
|
||||
success: Location.response(Schema.Array(Mcp.Server)),
|
||||
})
|
||||
.annotateMerge(locationQueryOpenApi)
|
||||
.annotateMerge(
|
||||
OpenApi.annotations({
|
||||
identifier: "v2.mcp.list",
|
||||
summary: "List MCP servers",
|
||||
description: "Retrieve configured MCP servers and their connection status.",
|
||||
}),
|
||||
),
|
||||
)
|
||||
.annotateMerge(OpenApi.annotations({ title: "mcp", description: "MCP server status routes." }))
|
||||
Loading…
Add table
Add a link
Reference in a new issue