Skip to content
Draft
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
25 changes: 24 additions & 1 deletion mocks/mcp-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export function createMcpApp(options: MockMcpServerOptions): HonoApp {
app.all('/mcp', async (c) => {
// Get account ID from header
const accountId = c.req.header('x-account-id') ?? 'default';
const tools = accountTools[accountId] ?? accountTools.default ?? [];
const accountSpecificTools = accountTools[accountId] ?? accountTools.default ?? [];
// The real MCP server registers submit_feedback unconditionally for every account, so mirror
// it here — the SDK inherits the feedback tool straight from the MCP catalog.
const tools = [...accountSpecificTools, submitFeedbackMcpTool];

// Create a new MCP server instance per request
const mcp = new McpServer({ name: 'test-mcp-server', version: '1.0.0' });
Expand Down Expand Up @@ -95,6 +98,26 @@ export function createMcpApp(options: MockMcpServerOptions): HonoApp {

// Pre-defined tool sets for common test scenarios

/**
* The global feedback tool the real MCP server always registers. Mirrored by the mock so tests
* exercise the same "feedback inherited from MCP" path as production.
*/
export const submitFeedbackMcpTool = {
name: 'submit_feedback',
description: 'Record a structured verdict on how well the tools served this session.',
inputSchema: {
type: 'object',
properties: {
rating: { type: 'string' },
source: { type: 'string' },
tool_names: { type: 'array', items: { type: 'string' } },
feedback: { type: 'string' },
session_id: { type: 'string' },
},
required: ['rating', 'source', 'tool_names'],
},
} as const satisfies McpToolDefinition;

export const defaultMcpTools = [
{
name: 'default_tool_1',
Expand Down
301 changes: 0 additions & 301 deletions src/feedback.test.ts

This file was deleted.

Loading
Loading