mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Support custom headers in MCP servers
This commit is contained in:
5 files changed
+127
-3
No files matched your search
@@ -21,8 +21,12 @@ export class MCPClient {
|
||||
capabilities: {}
|
||||
});
|
||||
|
||||
// Create HTTP transport
|
||||
this.transport = new StreamableHTTPClientTransport(new URL(server.url));
|
||||
// Create HTTP transport with optional custom headers
|
||||
this.transport = new StreamableHTTPClientTransport(new URL(server.url), {
|
||||
requestInit: server.headers ? {
|
||||
headers: server.headers,
|
||||
} : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,6 +45,7 @@ const providerModelSchema = z.string().regex(
|
||||
const mcpServerSchema: z.ZodType<MCPServer> = z.object({
|
||||
type: z.literal('streamable-http'),
|
||||
url: z.string().url(),
|
||||
headers: z.record(z.string(), z.string()).optional(),
|
||||
});
|
||||
|
||||
const aiSettingsSchema = z.object({
|
||||
|
||||
Reference in new issue
Block a user