mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
fix: update mock MCP server configuration in tests
- Add status: 'connected' to mock MCP server - Add proper config object with transport details - Update test snapshots to reflect connected MCP server state - Fixes failing tests after MCP server filtering implementation
This commit is contained in:
parent
1aa827450c
commit
7e92618e43
4 changed files with 62 additions and 4 deletions
|
|
@ -519,7 +519,7 @@ The Model Context Protocol (MCP) enables communication between the system and MC
|
|||
|
||||
When a server is connected, you can use the server's tools via the `use_mcp_tool` tool, and access the server's resources via the `access_mcp_resource` tool.
|
||||
|
||||
|
||||
## test-server (`test-command`)
|
||||
## Creating an MCP Server
|
||||
|
||||
The user may ask you something along the lines of "add a tool" that does some function, in other words to create an MCP server that provides tools and resources that may connect to external APIs for example. If they do, you should obtain detailed instructions on this topic using the fetch_instructions tool, like this:
|
||||
|
|
|
|||
|
|
@ -519,7 +519,7 @@ The Model Context Protocol (MCP) enables communication between the system and MC
|
|||
|
||||
When a server is connected, you can use the server's tools via the `use_mcp_tool` tool, and access the server's resources via the `access_mcp_resource` tool.
|
||||
|
||||
|
||||
## test-server (`test-command`)
|
||||
## Creating an MCP Server
|
||||
|
||||
The user may ask you something along the lines of "add a tool" that does some function, in other words to create an MCP server that provides tools and resources that may connect to external APIs for example. If they do, you should obtain detailed instructions on this topic using the fetch_instructions tool, like this:
|
||||
|
|
|
|||
|
|
@ -170,7 +170,36 @@ const mockContext = {
|
|||
// Instead of extending McpHub, create a mock that implements just what we need
|
||||
const createMockMcpHub = (withServers: boolean = false): McpHub =>
|
||||
({
|
||||
getServers: () => (withServers ? [{ name: "test-server", disabled: false }] : []),
|
||||
getServers: () =>
|
||||
withServers
|
||||
? [
|
||||
{
|
||||
name: "test-server",
|
||||
disabled: false,
|
||||
status: "connected",
|
||||
config: JSON.stringify({ command: "test-command" }),
|
||||
tools: [],
|
||||
resourceTemplates: [],
|
||||
resources: [],
|
||||
instructions: undefined,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
getAllServers: () =>
|
||||
withServers
|
||||
? [
|
||||
{
|
||||
name: "test-server",
|
||||
disabled: false,
|
||||
status: "connected",
|
||||
config: JSON.stringify({ command: "test-command" }),
|
||||
tools: [],
|
||||
resourceTemplates: [],
|
||||
resources: [],
|
||||
instructions: undefined,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
getMcpServersPath: async () => "/mock/mcp/path",
|
||||
getMcpSettingsFilePath: async () => "/mock/settings/path",
|
||||
dispose: async () => {},
|
||||
|
|
|
|||
|
|
@ -170,7 +170,36 @@ const mockContext = {
|
|||
// Instead of extending McpHub, create a mock that implements just what we need
|
||||
const createMockMcpHub = (withServers: boolean = false): McpHub =>
|
||||
({
|
||||
getServers: () => (withServers ? [{ name: "test-server", disabled: false }] : []),
|
||||
getServers: () =>
|
||||
withServers
|
||||
? [
|
||||
{
|
||||
name: "test-server",
|
||||
disabled: false,
|
||||
status: "connected",
|
||||
config: JSON.stringify({ command: "test-command" }),
|
||||
tools: [],
|
||||
resourceTemplates: [],
|
||||
resources: [],
|
||||
instructions: undefined,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
getAllServers: () =>
|
||||
withServers
|
||||
? [
|
||||
{
|
||||
name: "test-server",
|
||||
disabled: false,
|
||||
status: "connected",
|
||||
config: JSON.stringify({ command: "test-command" }),
|
||||
tools: [],
|
||||
resourceTemplates: [],
|
||||
resources: [],
|
||||
instructions: undefined,
|
||||
},
|
||||
]
|
||||
: [],
|
||||
getMcpServersPath: async () => "/mock/mcp/path",
|
||||
getMcpSettingsFilePath: async () => "/mock/settings/path",
|
||||
dispose: async () => {},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue