Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ import { RagMcpAgentV2 } from "./mcp.js";
// Durable Object: issue/PR state store (SQLite-backed)
export { IssueStore } from "./store.js";

// Durable Object: MCP server — legacy stub (retained for migration compatibility only).
export { RagMcpAgent } from "./mcp.js";

// Durable Object: MCP server (tools: search_issues, get_issue_context, list_recent_activity)
export { RagMcpAgentV2 } from "./mcp.js";

Expand Down
15 changes: 15 additions & 0 deletions src/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* idFromName("user-{githubUserId}").
*/

import { DurableObject } from "cloudflare:workers";
import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";
Expand Down Expand Up @@ -65,6 +66,20 @@ function githubHeaders(token: string): Record<string, string> {
*/
const INCLUDE_CONTENT_MAX_DOCS = 5;

/**
* Legacy class retained solely to satisfy Cloudflare's "class must exist in
* script for classes declared in past migrations (v1 new_sqlite_classes)"
* constraint. MCP_OBJECT binding points to RagMcpAgentV2 now, so this class
* never receives live traffic. It exists only so `wrangler deploy` does not
* fail with "script does not export class 'RagMcpAgent'". A follow-up PR can
* delete this class together with a deleted_classes migration.
*/
export class RagMcpAgent extends DurableObject<Env> {
async fetch(): Promise<Response> {
return new Response("RagMcpAgent has been retired; use RagMcpAgentV2", { status: 410 });
}
}

export class RagMcpAgentV2 extends McpAgent<Env, unknown, McpProps> {
// @ts-expect-error -- McpServer version mismatch between top-level SDK and agents' bundled copy (same issue as webhook-mcp; wrangler resolves at bundle time)
server = new McpServer({
Expand Down
Loading