MCP Server Tools Not Visible in Claude Code
## Summary
The glab MCP server (`glab mcp serve`) successfully initializes and exposes 172 tools when tested directly via stdio, but Claude Code does not expose any of these tools in its available tool list, preventing AI-assisted GitLab workflows.
## Environment
- **glab version**: 1.80.4 (f4b518e9)
- **OS**: macOS Darwin 25.2.0
- **Claude Code**: CLI version (appears to be 2.0.65 based on app support directory)
- **Configuration**: `~/.claude/mcp-servers.json` with proper stdio configuration
## Expected Behavior
Based on [MR !2361](https://gitlab.com/gitlab-org/cli/-/merge_requests/2361) and the [official documentation](https://docs.gitlab.com/cli/mcp/serve/), Claude Code should expose glab MCP tools with naming like `mcp__gitlab__*` or `glab_*`, enabling natural language GitLab operations.
## Actual Behavior
1. Running `/mcp` in Claude Code shows: "Reconnected to gitlab"
2. However, **zero glab tools appear** in the available tool list
3. Other MCP servers (GitHub, Todoist, Google Workspace, PDF, etc.) work correctly and expose their tools
## Reproduction Steps
### 1. Verify MCP Server Works Directly
```bash
# Test initialization and tool listing
(echo '{"jsonrpc":"2.0","method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}},"id":1}'; \
echo '{"jsonrpc":"2.0","method":"tools/list","params":{},"id":2}') | \
/opt/homebrew/bin/glab mcp serve 2>&1 | grep -o '"name":"glab_[^"]*"' | wc -l
```
**Result**: Server returns **172 tools** including:
- `glab_issue_create`, `glab_issue_list`, `glab_issue_update`, etc.
- `glab_mr_create`, `glab_mr_list`, `glab_mr_merge`, etc.
- `glab_ci_*` tools for pipelines
- Many other commands
### 2. Check Claude Code Configuration
**~/.claude/mcp-servers.json**:
```json
{
"gitlab": {
"type": "stdio",
"command": "/opt/homebrew/bin/glab",
"args": ["mcp", "serve"],
"env": {
"GITLAB_TOKEN": "glpat-..."
}
}
}
```
### 3. Verify Token
```bash
echo $GITLAB_TOKEN # Shows valid token
glab auth status # Shows authenticated
```
### 4. Check Claude Code
- Launch Claude Code with `/mcp` command
- Server shows "Reconnected to gitlab"
- Query available tools - **no glab tools present**
- Compare with other MCP servers (GitHub, Todoist) which work correctly
## Investigation Findings
1. **MCP Protocol Handshake**: ✅ Server responds correctly to initialization
2. **Tool Enumeration**: ✅ Server returns 172 tools via `tools/list`
3. **Authentication**: ✅ GITLAB_TOKEN is valid and set
4. **Process Status**: ❌ `ps aux | grep "glab mcp"` shows no running process (expected for stdio?)
5. **Logs**: No `mcp-server-gitlab.log` or similar file in `~/Library/Logs/Claude/`
## Hypothesis
Possible causes:
1. **Tool naming convention**: Claude Code might filter tools that don't follow `mcp__<server>__*` pattern (glab uses `glab_*`)
2. **Tool count limit**: 172 tools might exceed an internal limit or cause timeout during registration
3. **Connection failure**: Server might be failing to start or maintain connection despite "Reconnected" message
4. **Namespace collision**: Tool names might conflict with internal tooling
## Comparison with Working MCP Servers
Other MCP servers in the same configuration that **do work**:
- `mcp__github__*` (GitHub - ~40 tools)
- `mcp__todoist__*` (Todoist - ~30 tools)
- `mcp__google-workspace__*` (Google - ~20 tools)
- `mcp__pdf__*` (PDF - ~40 tools)
All use the `mcp__<server>__*` naming convention.
## Workaround
Users can invoke glab commands directly via Claude Code's Bash tool:
```bash
glab issue list
glab mr create
```
However, this loses the benefits of structured tool integration (type safety, parameter validation, AI-friendly schemas).
## Questions
1. Is the `glab_*` naming convention intentional, or should tools be exposed as `mcp__gitlab__*`?
2. Are there known limits on tool count per MCP server in Claude Code?
3. Should there be more verbose logging when tool registration fails?
4. Has this been tested with the latest Claude Code releases?
## References
- [glab mcp serve documentation](https://docs.gitlab.com/cli/mcp/serve/)
- [MCP Server MR !2361](https://gitlab.com/gitlab-org/cli/-/merge_requests/2361)
- [MCP Server Troubleshooting](https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server_troubleshooting/)
issue