github / github/copilot-cli

MCP servers configured but tools not exposed to AI assistant in Copilot CLI

Aberta
#191 13 comentários 16 reações 0 responsáveis Ver no GitHub
area:mcp area:tools
Linguagem predominante
Shell
Estrelas
11.2k
Forks
1.9k
Merge médio
14h 16min
PRs com merge (30d)
6

Descrição

# GitHub Copilot MCP Integration Issue Report

**Date**: 2025-10-03
**Version**: GitHub Copilot CLI 0.0.333
**Platform**: macOS (Darwin)

---

## 🐛 Issue Summary

**MCP servers are configured but their tools are not exposed to the AI assistant in GitHub Copilot CLI sessions.**

---

## 📋 Environment Details

### MCP Configuration File Location
```
~/.copilot/mcp-config.json
```

### Configured MCP Servers (3 total)

#### 1. Serena
- **Type**: local
- **Command**: `uvx`
- **Args**: `--from git+https://github.com/oraios/serena serena start-mcp-server`
- **Tools**: `*` (all tools enabled)
- **Status**: Can be manually started ✅
- **Tools Exposed to AI**: ❌ None visible

#### 2. Context7
- **Type**: local
- **Command**: `npx`
- **Args**: `-y @upstash/context7-mcp@latest`
- **Tools**: `*` (all tools enabled)
- **Status**: Unknown
- **Tools Exposed to AI**: ❌ None visible

#### 3. Sequential Thinking
- **Type**: local
- **Command**: `npx`
- **Args**: `-y @modelcontextprotocol/server-sequential-thinking`
- **Tools**: `*` (all tools enabled)
- **Status**: Process running ✅
- **Tools Exposed to AI**: ❌ None visible

---

## 🔍 What We Observed

### Tools Currently Visible to AI Assistant

The AI assistant can see and use:
- ✅ `bash` - Execute shell commands
- ✅ `str_replace_editor` - File editing operations
- ✅ `github-mcp-server-*` - 30+ GitHub-related tools (e.g., `get_pull_request`, `search_code`, etc.)

### Tools NOT Visible Despite Configuration

Despite proper MCP configuration, the AI cannot see:
- ❌ Any `serena-*` tools (26 tools available in Serena)
- ❌ Any `context7-*` tools
- ❌ Any `sequential-thinking-*` tools

---

## 🧪 Testing Performed

### 1. Verified MCP Configuration File
```bash
$ cat ~/.copilot/mcp-config.json
# Configuration is valid JSON with correct structure
```

### 2. Verified Serena Can Start
```bash
$ uvx --from git+https://github.com/oraios/serena serena start-mcp-server
INFO Starting Serena server (version=0.1.4)
INFO Available projects: [PROJECT_NAME]
INFO Loaded tools (36): read_file, create_text_file, find_symbol, ...
INFO Number of exposed tools: 26
INFO Serena web dashboard at http://127.0.0.1:24282/dashboard/index.html
# Server starts successfully ✅
```

### 3. Verified Serena Tools List
```bash
$ uvx --from git+https://github.com/oraios/serena serena tools list
# Returns 26 tools including:
- activate_project
- find_symbol
- find_referencing_symbols
- read_file
- create_text_file
- write_memory
- execute_shell_command
- replace_regex
- get_symbols_overview
- insert_after_symbol
- insert_before_symbol
- list_memories
- onboarding
- think_about_collected_information
- think_about_task_adherence
- think_about_whether_you_are_done
# ... and more
```

### 4. Checked Running Processes
```bash
$ ps aux | grep -E "(serena|context7|sequential-thinking|mcp)"
# Sequential Thinking is running ✅
# Serena was not running initially (can be started manually)
```

### 5. Verified Environment
```bash
$ which uvx
# uvx is available in PATH
$ uvx --version
uvx 0.8.13

$ which npx
# npx is available in PATH
$ npx --version
10.9.2
```

---

## 🎯 Expected Behavior

When MCP servers are configured in `~/.copilot/mcp-config.json`, the AI assistant should:

1. ✅ Automatically connect to configured MCP servers
2. ✅ Expose MCP server tools in the AI's tool list
3. ✅ Allow the AI to invoke these tools when appropriate
4. ✅ Show tool names prefixed with server name (e.g., `serena-read_file`)

---

## ❌ Actual Behavior

1. ❌ MCP servers are configured but not connected
2. ❌ MCP tools are not visible in AI's tool list
3. ❌ AI cannot invoke MCP tools even when explicitly requested
4. ❌ No error messages or warnings about MCP connection failures

---

## 💬 User Experience Impact

### What the User Experienced

1. User installed and configured 3 MCP servers
2. User asked AI to "use Serena to analyze the project"
3. AI performed analysis using only built-in tools (bash, str_replace_editor)
4. AI did NOT use Serena despite explicit request
5. User questioned why Serena wasn't used
6. Investigation revealed tools are not exposed to AI

### User's Confusion

- ✅ Configuration file exists and is valid
- ✅ MCP servers can be started manually
- ✅ MCP servers report their tools correctly
- ❌ But AI cannot see or use these tools
- ❓ **No feedback to user about what went wrong**

---

## 🔧 Reproduction Steps

1. Install MCP servers:
```bash
# Install uvx (for Serena)
pip install uv

# Install npx (for Context7 and Sequential Thinking)
# Usually comes with Node.js
```

2. Configure MCP in `~/.copilot/mcp-config.json`:
```json
{
"mcpServers": {
"serena": {
"tools": ["*"],
"type": "local",
"command": "uvx",
"args": ["--from git+https://github.com/oraios/serena serena start-mcp-server"]
},
"context7": {
"tools": ["*"],
"type": "local",
"command": "npx",
"args": ["-y @upstash/context7-mcp@latest"]
},
"sequential-thinking": {
"type": "local",
"command": "npx",
"tools": ["*"],
"args": ["-y @modelcontextprotocol/server-sequential-thinking"]
}
}
}
```

3. Start a GitHub Copilot CLI session

4. Ask AI to list available tools or explicitly use MCP tools

5. Observe that MCP tools are not available

---

## 💡 Suggested Solutions

### For GitHub Team

1. **Add MCP Connection Diagnostics**
- Show MCP server connection status in Copilot output
- Provide clear error messages when MCP servers fail to connect
- Add a command like `gh copilot mcp status` to check configuration

2. **Auto-start MCP Servers**
- Automatically start configured MCP servers when Copilot CLI initializes
- Show startup progress/failures
- Provide logs for debugging

3. **Better Documentation**
- Document how MCP integration works in Copilot CLI
- Explain expected tool naming conventions
- Provide troubleshooting guide
- Show examples of working configurations

4. **Tool Visibility**
- Add command to list all available tools: `gh copilot tools list`
- Show which tools come from which MCP server
- Indicate tool source (built-in vs MCP server)

5. **Error Handling**
- Show warnings if MCP servers are configured but not running
- Provide helpful error messages with resolution steps
- Log MCP connection attempts and failures

### For Users (Workarounds)

1. **Manual Server Start**
- Start MCP servers manually before using Copilot
- Use Serena's web dashboard for direct access: http://127.0.0.1:24282/dashboard/

2. **Use Built-in Tools**
- Continue using `bash` and `str_replace_editor` for now
- Wait for MCP integration improvements

3. **Check Logs**
- Look for Copilot CLI logs
- Check MCP server logs (e.g., Serena logs in `~/.serena/logs/`)

---

## 📊 System Information

```
OS: macOS (Darwin)
GitHub Copilot CLI Version: 0.0.333
MCP Config: ~/.copilot/mcp-config.json

MCP Servers Configured: 3
- Serena (uvx) - v0.1.4
- Context7 (npx)
- Sequential Thinking (npx)

Tools Visible to AI: ~35
- bash, str_replace_editor, write_bash, read_bash, stop_bash
- github-mcp-server-* (30+ tools)

Tools NOT Visible: All MCP server tools
- serena-* (26 tools expected)
- context7-* (unknown count)
- sequential-thinking-* (unknown count)
```

---

## 📎 Additional Context

### Why This Matters

MCP (Model Context Protocol) is designed to extend AI capabilities with specialized tools. In this case:

- **Serena**: Provides advanced code navigation, symbol search, project understanding, and intelligent code editing
- **Context7**: Offers semantic memory and vector search capabilities
- **Sequential Thinking**: Enables structured reasoning and step-by-step problem solving

Without these tools working, users lose significant value from their MCP investment and cannot leverage advanced AI capabilities.

### What We Tried

1. ✅ Verified configuration syntax (valid JSON)
2. ✅ Manually started Serena (works correctly)
3. ✅ Checked Serena tools list (26 tools available)
4. ✅ Verified executables (uvx, npx) are in PATH
5. ✅ Confirmed Sequential Thinking process is running
6. ❌ Could not find way to connect MCP to Copilot session
7. ❌ Could not find diagnostics for MCP connection issues
8. ❌ No error logs or warnings about MCP integration

### GitHub MCP Server Works

Notably, the `github-mcp-server-*` tools ARE visible and working, which suggests:
- The MCP infrastructure exists in Copilot CLI
- GitHub's own MCP server is properly integrated
- Third-party MCP servers may need different integration approach
- Or there's a configuration/discovery issue with third-party servers

---

## 🙏 Request

Please investigate and fix the MCP tool integration in GitHub Copilot CLI, or provide:

1. ✅ Clear documentation on how MCP integration works
2. ✅ Diagnostic commands to troubleshoot issues
3. ✅ Error messages when MCP servers fail to connect
4. ✅ Expected behavior and known limitations
5. ✅ Examples of working MCP configurations
6. ✅ Troubleshooting guide for common issues

---

## 📧 How to Submit

**Option 1: GitHub Issues**
- Repository: https://github.com/github/copilot-issues
- Category: GitHub Copilot CLI
- Label: MCP Integration

**Option 2: IDE/Editor Feedback**
- Use the feedback mechanism in your IDE/editor
- Mention "MCP tool integration issue"

**Option 3: Community Forum**
- GitHub Community Discussions
- Tag: copilot-cli, mcp

---

## 🔗 Related Links

- **MCP Specification**: https://modelcontextprotocol.io/
- **Serena GitHub**: https://github.com/oraios/serena
- **Context7 MCP**: https://www.npmjs.com/package/@upstash/context7-mcp
- **Sequential Thinking**: https://www.npmjs.com/package/@modelcontextprotocol/server-sequential-thinking

---

**Generated**: 2025-10-03
**Report Version**: 1.0 (Anonymized)

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.