Skip to content

[bug] MCP example outdated #2032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
complyue opened this issue Mar 27, 2025 · 6 comments · Fixed by #3699
Closed

[bug] MCP example outdated #2032

complyue opened this issue Mar 27, 2025 · 6 comments · Fixed by #3699
Assignees
Labels
bug Something isn't working enhancement New feature or request Issue - In Progress Someone is actively working on this. Should link to a PR soon.

Comments

@complyue
Copy link

Which version of the app are you using?

3.10.5

Which API Provider are you using?

OpenAI Compatible

Which Model are you using?

deepseek-r1

What happened?

can not write a working tool

Steps to reproduce

  1. ask roo to add a ts tool
  2. it struggles to build the tool
  3. tell it the latest example at https://github.com/modelcontextprotocol/typescript-sdk/blob/784012946dbc28f69708061863da6733f91c6696/README.md?plain=1#L45-L77
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";

// Create an MCP server
const server = new McpServer({
  name: "Demo",
  version: "1.0.0"
});

// Add an addition tool
server.tool("add",
  { a: z.number(), b: z.number() },
  async ({ a, b }) => ({
    content: [{ type: "text", text: String(a + b) }]
  })
);

// Add a dynamic greeting resource
server.resource(
  "greeting",
  new ResourceTemplate("greeting://{name}", { list: undefined }),
  async (uri, { name }) => ({
    contents: [{
      uri: uri.href,
      text: `Hello, ${name}!`
    }]
  })
);

// Start receiving messages on stdin and sending messages on stdout
const transport = new StdioServerTransport();
await server.connect(transport);

instruct it to finish the tool writing and done.

Relevant API REQUEST output

Additional context

No response

@complyue complyue added the bug Something isn't working label Mar 27, 2025
@complyue
Copy link
Author

maybe it's a bad idea to embed MCP examples/docs in Roo's codebase? better to download/setup a tool project with deps' doc and instruct Roo to read the latest stuff?

@hannesrudolph hannesrudolph added enhancement New feature or request Issue - Unassigned / Actionable Clear and approved. Available for contributors to pick up. labels Apr 1, 2025
@hannesrudolph hannesrudolph moved this from New to Issue [Unassigned] in Roo Code Roadmap Apr 1, 2025
@cannuri
Copy link

cannuri commented Apr 30, 2025

@complyue usually when you ask Roo to add/create an MCP server it should first fetch the instructions for create_mcp_server and act based on those. Is it possible that it is not fetching those beforehand and therefore failing?

@complyue
Copy link
Author

complyue commented May 6, 2025

@cannuri I think Roo has fetched instructions at: https://github.com/RooVetGit/Roo-Code/blob/main/src/core/prompts/instructions/create-mcp-server.ts

That's why I assume the instructions are hard-coded by far and tend to out-date.

@cannuri
Copy link

cannuri commented May 9, 2025

@cannuri I think Roo has fetched instructions at: https://github.com/RooVetGit/Roo-Code/blob/main/src/core/prompts/instructions/create-mcp-server.ts

That's why I assume the instructions are hard-coded by far and tend to out-date.

@complyue Well not directly. The instructions will get fetched once Roo recognizes that they are needed (to save tokens in the system prompt). Please try the following Having "Enable MCP Server Creation" enabled add use the instructions in create_mcp_server for creating the following MCP Server: ... followed by your request. It should then use fetch_instructions to get the instructions for creating an MCP server and then handle it correctly.

Could you please test and confirm?

@complyue
Copy link
Author

complyue commented May 9, 2025

Could you please test and confirm?

I did exactly that, Roo would create code following the example at https://github.com/RooVetGit/Roo-Code/blob/main/src/core/prompts/instructions/create-mcp-server.ts and doesn't compile due to mismatching latest mcp sdk interface.

@nexon33
Copy link

nexon33 commented May 16, 2025

I'll take a look at this, should be an easy fix

@hannesrudolph hannesrudolph moved this from New to Issue [Unassigned] in Roo Code Roadmap May 20, 2025
@hannesrudolph hannesrudolph moved this from Issue [Unassigned] to Issue [In Progress] in Roo Code Roadmap May 21, 2025
@hannesrudolph hannesrudolph added Issue - In Progress Someone is actively working on this. Should link to a PR soon. and removed Issue - Unassigned / Actionable Clear and approved. Available for contributors to pick up. labels May 21, 2025
@github-project-automation github-project-automation bot moved this from Issue [In Progress] to Done in Roo Code Roadmap May 28, 2025
@github-project-automation github-project-automation bot moved this from Issue [Unassigned] to Done in Roo Code Roadmap May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Issue - In Progress Someone is actively working on this. Should link to a PR soon.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants