Skip to content

feat: add comprehensive MCP server tests#102

Merged
ryoppippi merged 2 commits intomainfrom
mcp-test
Jun 17, 2025
Merged

feat: add comprehensive MCP server tests#102
ryoppippi merged 2 commits intomainfrom
mcp-test

Conversation

@ryoppippi
Copy link
Owner

@ryoppippi ryoppippi commented Jun 17, 2025

Summary

This PR adds comprehensive test coverage for the MCP (Model Context Protocol) server functionality, covering both stdio and HTTP transport modes.

⚠️ BREAKING CHANGES

🚨 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:

  • Replaced fastmcp with official MCP SDK for better compatibility and future-proofing
  • HTTP transport now uses Hono framework by @yusukebe for improved performance and developer experience
  • This provides more robust MCP protocol support and better HTTP handling

Changes Made

  • In-Source Testing: Added tests using the if (import.meta.vitest != null) pattern directly in src/mcp.ts
  • Stdio Transport Tests: Test server creation, tool listing, and individual tool calls with mock Claude data
  • HTTP Transport Tests: Test Hono app creation, HTTP request handling, and error responses
  • Mock Data: Use fs-fixture with createFixture() to simulate Claude data directory structure
  • Documentation: Updated CLAUDE.md with in-source testing guidelines and patterns

Test Coverage

  • MCP server creation with default/custom options
  • Stdio transport connection and tool listing (4 tools: daily, session, monthly, blocks)
  • All MCP tools execute successfully and return valid JSON data
  • HTTP transport handles valid POST requests and returns proper error codes
  • Error handling for malformed JSON and invalid HTTP methods

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.

- 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.
@coderabbitai
Copy link

coderabbitai bot commented Jun 17, 2025

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

📥 Commits

Reviewing files that changed from the base of the PR and between e59a7f6 and c5efa11.

📒 Files selected for processing (1)
  • src/mcp.ts (2 hunks)

Walkthrough

This update introduces comprehensive Vitest-based unit and integration tests for the MCP server in src/mcp.ts, covering stdio and HTTP transports, tool interactions, and error handling. It also expands the project's documentation in CLAUDE.md with detailed testing guidelines, including test embedding, fixture usage, and best practices.

Changes

File(s) Change Summary
CLAUDE.md Added detailed testing guidelines: in-source test pattern, Vitest globals usage, dynamic import restrictions, fs-fixture.
src/mcp.ts Added extensive Vitest-based unit and integration tests for MCP server, tools, transports, and error scenarios.

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
Loading

Possibly related PRs

Poem

In burrows deep, the tests now run,
With fixtures set and mocks begun.
MCP hops through HTTP and streams,
Each tool now tested, or so it seems.
Vitest magic in every file,
This rabbit grins—a tested mile! 🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts using the if (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-fixture to create temporary file system structures, effectively simulating Claude data directories for isolated and reliable testing.
  • Documentation Update: Updated CLAUDE.md to 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

  1. 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.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jun 17, 2025

Open in StackBlitz

npm i https://pkg.pr.new/ryoppippi/ccusage@102

commit: c5efa11

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The test should handle valid POST requests without 405 error only asserts that the HTTP status is not 405. Enhance this test, or add a new one, to verify a successful tool call and its output over HTTP to ensure the HTTP transport functions correctly.

});
});

describe('stdio transport', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The setup for fixture, client, server, and InMemoryTransport is repeated in each test case within the stdio transport block. Consider extracting this common setup into a beforeEach hook to improve maintainability.

src/mcp.ts Outdated
Comment on lines +291 to +294
// 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');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
Comment on lines +296 to +297
// 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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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);

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-new McpServer + StreamableHTTPServerTransport for every incoming POST.
For high-QPS scenarios this will:

  1. Re-parse Zod schemas and handlers repeatedly.
  2. Leak memory if close() is missed on early client disconnects.
  3. 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 helper

Every 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: include Allow header for 405 responses

RFC 9110 suggests sending an Allow header 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

📥 Commits

Reviewing files that changed from the base of the PR and between 380e618 and e59a7f6.

📒 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 contract

Clear, 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
@ryoppippi ryoppippi merged commit 4951611 into main Jun 17, 2025
10 checks passed
@ryoppippi ryoppippi deleted the mcp-test branch June 17, 2025 22:37
ryoppippi added a commit that referenced this pull request Jun 22, 2025
feat: add comprehensive MCP server tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant