8000 add support for mcp server instructions by qingyuan1109 · Pull Request #3260 · RooVetGit/Roo-Code · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

add support for mcp server instructions #3260

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/core/prompts/sections/mcp-servers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export async function getMcpServersSection(

return (
`## ${server.name} (\`${config.command}${config.args && Array.isArray(config.args) ? ` ${config.args.join(" ")}` : ""}\`)` +
(server.instructions ? `\n\n${server.instructions}` : "") +
(tools ? `\n\n### Available Tools\n${tools}` : "") +
(templates ? `\n\n### Resource Templates\n${templates}` : "") +
(resources ? `\n\n### Direct Resources\n${resources}` : "")
Expand Down
1 change: 1 addition & 0 deletions src/services/mcp/McpHub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,7 @@ export class McpHub {
await client.connect(transport)
connection.server.status = "connected"
connection.server.error = ""
connection.server.instructions = client.getInstructions()

// Initial fetch of tools and resources
connection.server.tools = await this.fetchToolsList(name, source)
Expand Down
1 change: 1 addition & 0 deletions src/shared/mcp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type McpServer = {
timeout?: number
source?: "global" | "project"
projectPath?: string
instructions?: string
}

export type McpTool = {
Expand Down
10 changes: 10 additions & 0 deletions webview-ui/src/components/mcp/McpView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,16 @@ const ServerRow = ({ server, alwaysAllowMcp }: { server: McpServer; alwaysAllowM
{server.status === "connected" ? (
isExpanded && (
<div className="bg-vscode-textCodeBlock-background px-[10px] pb-[10px] text-[13px] rounded-b-[4px]">
{server.instructions && (
<div
style={{
padding: "5px 0",
opacity: 0.8,
fontSize: "12px",
}}>
{server.instructions}
</div>
)}
<VSCodePanels className="mb-[10px]">
<VSCodePanelTab id="tools">
{t("mcp:tabs.tools")} ({server.tools?.length || 0})
Expand Down
0