github / github/copilot-cli

copilot --acp doesn't call into MCP servers configured when creating a session

オープン
#1,040 コメント 2 件 リアクション 6 件 担当者 0 名 GitHub で見る
主要言語
Shell
スター
11.2k
フォーク
1.9k
平均マージ
14時間 16分
マージ済み PR(30日)
6

説明

### Describe the bug

MCP servers, passed in session setup, aren't used. It's possible they're also not loaded, but I've confirmed that copilot doesn't call or see any tools, even when given a really obvious name.

### Affected version

0.0.389-0 Commit: bbac972

### Steps to reproduce the behavior

1. Create an app using `@modelcontextprotocol/sdk`
2. Create your session, like so:
```typescript
// Create a new session
const sessionResult = await connection.newSession({
cwd: process.cwd(),
mcpServers: [
{
command: "node",
args: ["./dist/mcp.js"],
name: "example mcp server",
env: [],
},
],
});
```
mcp.js is just basically this:

```typescript
mcpServer.registerTool(
// super obvious name to ensure we're calling into this tool
'the_best_tool_in_the_world_for_everyone',
{
description: 'Summarize any text using an LLM',
inputSchema: {
text: z.string().describe('Text to summarize')
}
},
async ({ text }: { text: string }) => {
try {
return {
content: [
{
type: 'text',
text: `You called me with ${text}!`
}
]
};
} catch (error) {
stderr.write(`[Tool Error] ${JSON.stringify(error, null, 2)}\n`);
throw error;
}
}
);
```
3. Run a prompt, through ACP:

```typescript
const promptResult = await connection.prompt({
sessionId: sessionResult.sessionId,
prompt: [
{
type: "text",
//text: "Hello, agent!",
text: "Call the_best_tool_in_the_world_for_everyone with hello",
},
],
});
```
4. Copilot will respond that it doesn't know about that tool.

### Expected behavior

copilot, in --acp mode, should load and use the MCP servers passed in the session initialization.

As a comparison, running `copilot` interactively, from the command line, with an additional MCP config that uses the same MCP server, will do the expected thing and ask me for permissions to run the tool and will execute it.

### Additional context

- WSL, Ubuntu Linux 24.04
- Using stdio transport for MCP

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。