Conversation
- Add in-source tests for MCP server functionality using vitest pattern - Test stdio transport with InMemoryTransport for client-server communication - Test HTTP transport with Hono app request/response handling - Validate all 4 MCP tools (daily, session, monthly, blocks) work correctly - Mock Claude data directory using fs-fixture for isolated testing - Test error handling for invalid JSON, method not allowed scenarios - Update CLAUDE.md with in-source testing guidelines and patterns The tests ensure MCP server works correctly in both stdio and HTTP modes, providing comprehensive coverage for external integrations.
|
Warning Rate limit exceeded@ryoppippi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 36 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
WalkthroughThis update introduces comprehensive Vitest-based unit and integration tests for the MCP server in Changes
Sequence Diagram(s)sequenceDiagram
participant TestSuite
participant MCPServer
participant Transport
participant MCPClient
participant HonoApp
participant fsFixture
TestSuite->>fsFixture: createFixture() (mock data)
TestSuite->>MCPServer: createServer(options)
TestSuite->>Transport: setup in-memory transport pair
TestSuite->>MCPClient: connect to MCPServer via Transport
MCPClient->>MCPServer: listTools / callTool (daily, session, monthly, blocks)
MCPServer-->>MCPClient: respond with tool data
TestSuite->>HonoApp: send HTTP POST/GET/DELETE requests
HonoApp-->>TestSuite: respond with JSON-RPC or error
TestSuite->>MCPClient: close connection
TestSuite->>MCPServer: shutdown server
Possibly related PRs
Poem
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Summary of Changes
Hello @ryoppippi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly enhances the test coverage for the Model Context Protocol (MCP) server, introducing comprehensive tests for both its stdio and HTTP transport mechanisms. The goal is to ensure the server's robustness and correct functionality across different integration points, following the project's in-source testing pattern.
Highlights
- Comprehensive MCP Server Testing: Introduced extensive test coverage for the Model Context Protocol (MCP) server, specifically targeting both stdio and HTTP transport modes.
- In-Source Testing Adoption: Implemented tests directly within
src/mcp.tsusing theif (import.meta.vitest != null)pattern, aligning with the project's new testing guidelines. - Stdio Transport Validation: Added tests to verify stdio transport functionality, including successful server connection, accurate listing of all four MCP tools (daily, session, monthly, blocks), and correct execution of each tool with mocked Claude data.
- HTTP Transport Validation: Developed tests for the HTTP transport, ensuring proper Hono app creation, handling of valid POST requests, and robust error responses for unsupported HTTP methods (GET, DELETE) and malformed JSON payloads.
- Mock Data Management: Utilized
fs-fixtureto create temporary file system structures, effectively simulating Claude data directories for isolated and reliable testing. - Documentation Update: Updated
CLAUDE.mdto reflect the new in-source testing guidelines and patterns, providing clear instructions for future test development.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
commit: |
There was a problem hiding this comment.
Code Review
This PR introduces a comprehensive test suite for the MCP server, covering stdio and HTTP transports. To further improve the test suite, consider enhancing type safety, reducing code repetition in the stdio tests, and adding a positive test case for successful HTTP tool calls.
| expect(app).toBeDefined(); | ||
| }); | ||
|
|
||
| it('should handle valid POST requests without 405 error', async () => { |
| }); | ||
| }); | ||
|
|
||
| describe('stdio transport', () => { |
src/mcp.ts
Outdated
| // eslint-disable-next-line ts/no-unsafe-call, ts/no-unsafe-member-access | ||
| expect((result.content as any).at(0)).toHaveProperty('type', 'text'); | ||
| // eslint-disable-next-line ts/no-unsafe-call, ts/no-unsafe-member-access | ||
| expect((result.content as any).at(0)).toHaveProperty('text'); |
There was a problem hiding this comment.
Using (result.content as any).at(0) and disabling ts/no-unsafe-call / ts/no-unsafe-member-access can hide potential type errors. Consider checking result.content.length before accessing result.content[0] and using type guards if necessary.
expect(result.content).toHaveLength(1);
expect(result.content[0]).toHaveProperty('type', 'text');
expect(result.content[0]).toHaveProperty('text');
src/mcp.ts
Outdated
| // eslint-disable-next-line ts/no-unsafe-assignment, ts/no-unsafe-call, ts/no-unsafe-member-access | ||
| const data = JSON.parse((result.content as any).at(0).text as string); |
There was a problem hiding this comment.
Using (result.content as any).at(0).text as string along with disabling ts/no-unsafe-* rules should be avoided. If result.content[0] is confirmed to be a text block, the as string cast is redundant; otherwise, use a type check.
const firstTextContent = result.content[0]?.text;
if (typeof firstTextContent !== 'string') {
throw new Error('Test assumption failed: result.content[0].text is not a string.');
}
const data = JSON.parse(firstTextContent);There was a problem hiding this comment.
Actionable comments posted: 1
🔭 Outside diff range comments (1)
src/mcp.ts (1)
156-174: One MCP server instance per request hurts throughput
createMcpHttpApp()builds a brand-newMcpServer+StreamableHTTPServerTransportfor every incoming POST.
For high-QPS scenarios this will:
- Re-parse Zod schemas and handlers repeatedly.
- Leak memory if
close()is missed on early client disconnects.- Increase latency due to handshake on each call.
Consider:
- app.post('/', async (c) => { - const { req, res } = toReqRes(c.req.raw); - const mcpServer = createMcpServer(options); - const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined }); - await mcpServer.connect(transport); + const mcpServer = createMcpServer(options); + const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined }); + await mcpServer.connect(transport); + + app.post('/', async (c) => { + const { req, res } = toReqRes(c.req.raw);Reuse the same server/transport pair, add a health-check to ensure it’s alive, and call
transport.handleRequest()per request.
Throughput will improve and resource churn will drop considerably.
🧹 Nitpick comments (2)
src/mcp.ts (2)
260-286: Heavy duplication – extract a test helperEvery tool test repeats fixture creation, server/client wiring and teardown.
A tiny helper will shrink ~150 LOC and ease future maintenance:+# test utils (inside the vitest block, above test suites) +async function withServer<T>( + fixtureFiles: Parameters<typeof createFixture>[0], + fn: (ctx: { + client: Client; + server: McpServer; + fixture: Awaited<ReturnType<typeof createFixture>>; + }) => Promise<T>, +) { + await using fixture = await createFixture(fixtureFiles); + const client = new Client({ name: 'test-client', version: '1.0.0' }); + const server = createMcpServer({ claudePath: fixture.path }); + const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair(); + await Promise.all([client.connect(clientTransport), server.connect(serverTransport)]); + try { + return await fn({ client, server, fixture }); + } finally { + await client.close(); + await server.close(); + } +}Then a test becomes:
await withServer(sample, async ({ client }) => { const res = await client.callTool({ name: 'daily', arguments: { mode: 'auto' } }); expect((res as any).content).toHaveLength(1); });Cleaner, faster to read, easier to extend.
Also applies to: 304-330, 345-371, 386-412
177-189: Nit: includeAllowheader for 405 responsesRFC 9110 suggests sending an
Allowheader listing permitted methods.
Minor, but improves API ergonomics and tooling support.- return c.json({ … }, 405); + return c.json({ … }, 405, { headers: { Allow: 'POST' } });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
CLAUDE.md(1 hunks)src/mcp.ts(2 hunks)
🧰 Additional context used
🪛 ESLint
src/mcp.ts
[error] 210-210: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 211-211: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 212-212: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 213-213: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 214-214: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 214-214: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 214-214: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 217-217: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 218-218: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 219-219: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 219-219: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 219-219: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 223-223: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 224-224: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 225-235: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 225-225: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 237-237: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 237-237: Unsafe construction of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 238-238: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 238-238: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 238-238: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 240-240: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 240-240: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 240-240: Unsafe member access .createLinkedPair on an error typed value.
(ts/no-unsafe-member-access)
[error] 243-243: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 243-243: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 244-244: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 244-244: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 247-247: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 247-247: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 247-247: Unsafe member access .listTools on an error typed value.
(ts/no-unsafe-member-access)
[error] 248-248: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 248-248: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 248-248: Unsafe member access .tools on an error typed value.
(ts/no-unsafe-member-access)
[error] 248-248: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 250-250: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 250-250: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 250-250: Unsafe member access .tools on an error typed value.
(ts/no-unsafe-member-access)
[error] 250-250: Unsafe return of a value of type any.
(ts/no-unsafe-return)
[error] 250-250: Unsafe member access .name on an any value.
(ts/no-unsafe-member-access)
[error] 251-251: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 251-251: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 251-251: Unsafe member access .toContain on an error typed value.
(ts/no-unsafe-member-access)
[error] 252-252: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 252-252: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 252-252: Unsafe member access .toContain on an error typed value.
(ts/no-unsafe-member-access)
[error] 253-253: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 253-253: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 253-253: Unsafe member access .toContain on an error typed value.
(ts/no-unsafe-member-access)
[error] 254-254: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 254-254: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 254-254: Unsafe member access .toContain on an error typed value.
(ts/no-unsafe-member-access)
[error] 256-256: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 256-256: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 257-257: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 257-257: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 260-260: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 261-271: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 261-261: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 273-273: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 273-273: Unsafe construction of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 274-274: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 274-274: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 274-274: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 276-276: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 276-276: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 276-276: Unsafe member access .createLinkedPair on an error typed value.
(ts/no-unsafe-member-access)
[error] 279-279: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 279-279: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 280-280: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 280-280: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 283-286: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 283-283: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 283-283: Unsafe member access .callTool on an error typed value.
(ts/no-unsafe-member-access)
[error] 288-288: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 288-288: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 288-288: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 289-289: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 289-289: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 289-289: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 289-289: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 290-290: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 290-290: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 290-290: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 290-290: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 298-298: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 298-298: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 298-298: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 300-300: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 300-300: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 301-301: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 301-301: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 304-304: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 305-315: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 305-305: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 317-317: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 317-317: Unsafe construction of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 318-318: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 318-318: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 318-318: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 320-320: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 320-320: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 320-320: Unsafe member access .createLinkedPair on an error typed value.
(ts/no-unsafe-member-access)
[error] 323-323: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 323-323: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 324-324: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 324-324: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 327-330: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 327-327: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 327-327: Unsafe member access .callTool on an error typed value.
(ts/no-unsafe-member-access)
[error] 332-332: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 332-332: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 332-332: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 333-333: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 333-333: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 333-333: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 333-333: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 334-334: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 334-334: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 334-334: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 334-334: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 335-335: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 335-335: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 335-335: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 335-335: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 339-339: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 339-339: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 339-339: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 341-341: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 341-341: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 342-342: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 342-342: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 345-345: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 346-356: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 346-346: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 358-358: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 358-358: Unsafe construction of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 359-359: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 359-359: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 359-359: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 361-361: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 361-361: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 361-361: Unsafe member access .createLinkedPair on an error typed value.
(ts/no-unsafe-member-access)
[error] 364-364: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 364-364: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 365-365: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 365-365: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 368-371: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 368-368: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 368-368: Unsafe member access .callTool on an error typed value.
(ts/no-unsafe-member-access)
[error] 373-373: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 373-373: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 373-373: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 374-374: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 374-374: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 374-374: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 374-374: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 375-375: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 375-375: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 375-375: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 375-375: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 376-376: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 376-376: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 376-376: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 376-376: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 380-380: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 380-380: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 380-380: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 382-382: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 382-382: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 383-383: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 383-383: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 386-386: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 387-397: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 387-387: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 399-399: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 399-399: Unsafe construction of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 400-400: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 400-400: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 400-400: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 402-402: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 402-402: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 402-402: Unsafe member access .createLinkedPair on an error typed value.
(ts/no-unsafe-member-access)
[error] 405-405: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 405-405: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 406-406: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 406-406: Unsafe member access .connect on an error typed value.
(ts/no-unsafe-member-access)
[error] 409-412: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 409-409: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 409-409: Unsafe member access .callTool on an error typed value.
(ts/no-unsafe-member-access)
[error] 414-414: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 414-414: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 414-414: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 415-415: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 415-415: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 415-415: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 415-415: Unsafe member access .toHaveLength on an error typed value.
(ts/no-unsafe-member-access)
[error] 416-416: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 416-416: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 416-416: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 416-416: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 417-417: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 417-417: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 417-417: Unsafe member access .content on an error typed value.
(ts/no-unsafe-member-access)
[error] 417-417: Unsafe member access .toHaveProperty on an error typed value.
(ts/no-unsafe-member-access)
[error] 421-421: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 421-421: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 421-421: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 423-423: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 423-423: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 424-424: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 424-424: Unsafe member access .close on an error typed value.
(ts/no-unsafe-member-access)
[error] 428-428: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 429-429: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 430-430: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 431-431: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 431-431: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 431-431: Unsafe member access .toBeDefined on an error typed value.
(ts/no-unsafe-member-access)
[error] 434-434: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 435-445: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 435-435: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 447-447: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 447-447: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 447-447: Unsafe member access .path on an error typed value.
(ts/no-unsafe-member-access)
[error] 456-460: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 456-456: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 456-456: Unsafe member access .request on an error typed value.
(ts/no-unsafe-member-access)
[error] 463-463: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 463-463: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 463-463: Unsafe member access .status on an error typed value.
(ts/no-unsafe-member-access)
[error] 463-463: Unsafe member access .not on an error typed value.
(ts/no-unsafe-member-access)
[error] 466-466: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 467-467: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 469-469: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 469-469: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 469-469: Unsafe member access .request on an error typed value.
(ts/no-unsafe-member-access)
[error] 471-471: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 471-471: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 471-471: Unsafe member access .status on an error typed value.
(ts/no-unsafe-member-access)
[error] 471-471: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 472-472: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 472-472: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 472-472: Unsafe member access .json on an error typed value.
(ts/no-unsafe-member-access)
[error] 473-473: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 473-473: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 473-473: Unsafe member access .toMatchObject on an error typed value.
(ts/no-unsafe-member-access)
[error] 483-483: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 484-484: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 486-486: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 486-486: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 486-486: Unsafe member access .request on an error typed value.
(ts/no-unsafe-member-access)
[error] 488-488: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 488-488: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 488-488: Unsafe member access .status on an error typed value.
(ts/no-unsafe-member-access)
[error] 488-488: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 489-489: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 489-489: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 489-489: Unsafe member access .json on an error typed value.
(ts/no-unsafe-member-access)
[error] 490-490: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 490-490: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 490-490: Unsafe member access .toMatchObject on an error typed value.
(ts/no-unsafe-member-access)
[error] 500-500: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 501-501: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 503-507: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 503-503: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 503-503: Unsafe member access .request on an error typed value.
(ts/no-unsafe-member-access)
[error] 509-509: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 509-509: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 509-509: Unsafe member access .status on an error typed value.
(ts/no-unsafe-member-access)
[error] 509-509: Unsafe member access .toBe on an error typed value.
(ts/no-unsafe-member-access)
[error] 510-510: Unsafe assignment of an error typed value.
(ts/no-unsafe-assignment)
[error] 510-510: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 510-510: Unsafe member access .json on an error typed value.
(ts/no-unsafe-member-access)
[error] 511-511: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 511-511: Unsafe call of a(n) error type typed value.
(ts/no-unsafe-call)
[error] 511-511: Unsafe member access .toMatchObject on an error typed value.
(ts/no-unsafe-member-access)
🪛 GitHub Actions: CI
src/mcp.ts
[error] 334-420: TypeScript error TS18046: 'result.content' is of type 'unknown' causing type errors at multiple lines (334, 335, 338, 375, 376, 379, 416, 417, 420).
🔇 Additional comments (1)
CLAUDE.md (1)
129-134: Good clarification of the in-source testing contractClear, concise and aligned with the implementation in
src/mcp.ts. No further action required.
- Fix type errors by using (result.content as any)[0] for test assertions - Add eslint-disable comment block for type safety in test code - Ensure all tests pass TypeScript strict mode checking
feat: add comprehensive MCP server tests
Summary
This PR adds comprehensive test coverage for the MCP (Model Context Protocol) server functionality, covering both stdio and HTTP transport modes.
🚨 Migration from valibot to zod: Schema validation now uses zod instead of valibot for better type safety and ecosystem compatibility
🚨 Migration from fastmcp to @modelcontextprotocol/sdk + Hono by @yusukebe:
Changes Made
Test Coverage
Testing Pattern
This follows the project in-source testing pattern with vitest globals and fs-fixture for mocking.
The tests ensure the MCP server works correctly for external integrations.