kiro-mcp-telemetry-wrapper
v1.0.0
Published
Telemetry wrapper for any MCP server
Downloads
136
Readme
MCP Telemetry Wrapper
Proxy transparente que intercepta tool calls entre o Kiro IDE e qualquer MCP Server, registrando metadados de telemetria (timestamp, toolName, duração, erros) sem alterar o comportamento do MCP original.
Kiro IDE → mcp-telemetry-wrapper → MCP Original
↓
events.jsonl (local)
ou endpoint HTTP (produção)Funciona com qualquer MCP do ecossistema: npm (npx), Python (uvx), local.
Instalação
npm install
npm run build
npm linkBuild
npm run buildGera dist/index.js com shebang — executável como mcp-telemetry-wrapper após npm link.
Uso
No mcp.json, substitua o command do MCP original por mcp-telemetry-wrapper e passe o pacote via --mcp:
"filesystem": {
"command": "mcp-telemetry-wrapper",
"args": [
"--mcp", "@modelcontextprotocol/server-filesystem",
"--mcp-args", "/Users/leandrorocha",
"--name", "filesystem",
"--dest", "file",
"--file", "/Users/leandrorocha/mcp-telemetry/events.jsonl"
],
"disabled": false
}O campo autoApprove e demais configurações do MCP original são preservados sem interferência.
Exemplos de mcp.json
Antes (sem wrapper)
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/leandrorocha"]
},
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
},
"fetch": {
"command": "uvx",
"args": ["mcp-server-fetch"]
},
"context7": {
"command": "npx",
"args": ["-y", "@upstash/context7-mcp"]
}
}
}Depois (com wrapper)
{
"mcpServers": {
"filesystem": {
"command": "mcp-telemetry-wrapper",
"args": [
"--mcp", "@modelcontextprotocol/server-filesystem",
"--mcp-args", "/Users/leandrorocha",
"--name", "filesystem"
]
},
"memory": {
"command": "mcp-telemetry-wrapper",
"args": [
"--mcp", "@modelcontextprotocol/server-memory",
"--name", "memory"
]
},
"fetch": {
"command": "mcp-telemetry-wrapper",
"args": [
"--mcp", "uvx:mcp-server-fetch",
"--name", "fetch"
]
},
"context7": {
"command": "mcp-telemetry-wrapper",
"args": [
"--mcp", "@upstash/context7-mcp",
"--name", "context7"
]
}
}
}O prefixo uvx: instrui o wrapper a usar uvx em vez de npx.
Opções CLI
| Opção | Tipo | Obrigatório | Padrão | Descrição |
|-------|------|:-----------:|--------|-----------|
| --mcp | string | ✅ | — | Pacote MCP a ser envolvido. Prefixo uvx: para MCPs Python |
| --mcp-args | string | — | — | Argumentos adicionais para o MCP (separados por espaço) |
| --name | string | — | nome do pacote | Nome amigável para identificação nos logs de telemetria |
| --dest | string | — | file | Destino da telemetria: file ou http |
| --file | string | — | ~/mcp-telemetry/events.jsonl | Caminho do arquivo JSONL (quando --dest file) |
| --endpoint | string | — | — | URL do endpoint HTTP (quando --dest http) |
| --include-args | boolean | — | true | Incluir argumentos da tool call nos eventos de telemetria |
Validação
Após configurar o wrapper no mcp.json e usar o Kiro normalmente:
# Acompanhar eventos em tempo real
tail -f ~/mcp-telemetry/events.jsonl
# Contar total de eventos registrados
wc -l ~/mcp-telemetry/events.jsonlExemplo de evento registrado:
{"timestamp":"2026-04-13T10:00:01.123Z","toolName":"read_file","mcpName":"filesystem","arguments":{"path":"/Users/leandrorocha/projeto/index.ts"},"responseCode":200,"durationMs":8}Testes
npm testExecuta testes unitários e property-based tests (fast-check) via vitest.
