Skip to content

feat: add read-only MCP knowledge server#141

Merged
ecarreras merged 6 commits into
mainfrom
issue-140-mcp-server
Jun 23, 2026
Merged

feat: add read-only MCP knowledge server#141
ecarreras merged 6 commits into
mainfrom
issue-140-mcp-server

Conversation

@pilipilisbot

@pilipilisbot pilipilisbot commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • add a read-only stdio MCP server for acquired bridge knowledge
  • add hashed MCP token creation/list/revoke storage, CLI commands, dashboard admin API endpoints, and an admin MCP token panel
  • add dashboard setup guidance for connecting local agents to the MCP server, including proxy-aware public dashboard URLs
  • document local-agent setup, the top-level README mention, and the exposed MCP tools/resources

Scope notes

This starts with stdio transport for local agents and keeps the MCP surface read-only: list_repositories, list_knowledge, and gab://knowledge/{owner}/{repo} resources. The stdio transport uses MCP Content-Length message framing so normal MCP clients can connect. The dashboard work in this PR includes an authenticated admin MCP token-management panel plus setup guidance with the public dashboard URL, stdio command, agent config snippet, and a suggested agent prompt. The public dashboard URL can be configured with GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL or derived from reverse-proxy forwarded headers. It intentionally does not expose an HTTP MCP endpoint in this release.

Tests

  • npm test
  • npm run build
  • .venv/bin/pytest -q

Closes #140

Screenshots

Desktop MCP setup and token management:

mcp-setup-desktop.png

Mobile MCP setup and token management:

mcp-setup-mobile.png

Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@pilipilisbot pilipilisbot mentioned this pull request Jun 23, 2026
@ecarreras

Copy link
Copy Markdown
Owner

@pilipilisbot com es veu això al dashboard?

pilipilisbot and others added 2 commits June 23, 2026 11:17
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@pilipilisbot

Copy link
Copy Markdown
Owner Author

Ara ja es veu al dashboard: he afegit una pestanya MCP per admins amb creacio de token, llistat de tokens actius i revocacio. Tambe he afegit el fallback SPA de /mcp perque funcioni en refresh/deep link.

Commit: 3e84f06 feat: add dashboard MCP token panel

Validacio:

  • npm test (41 passed)
  • npm run build
  • .venv/bin/pytest -q (291 passed, 1 warning existent de Starlette/httpx)

He actualitzat la descripcio del PR amb captures desktop i mobile: #141

@ecarreras

Copy link
Copy Markdown
Owner

@pilipilisbot També aniria bé que a la pàgina de MCP hi hagués info de com configurar-ho amb un agent, url pública del MCP, prompt per configurar, etc.

@ecarreras

Copy link
Copy Markdown
Owner

@pilipilisbot s'hauria de posar al README general que té un MCP?

Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@pilipilisbot

Copy link
Copy Markdown
Owner Author

Fet: he afegit a la pestanya MCP un bloc Connect an agent amb:

  • URL del dashboard MCP per compartir amb admins.
  • comandament gab ... mcp-serve i nota clara que aquest PR exposa MCP per stdio local, no un endpoint HTTP públic.
  • snippet de configuració mcpServers amb GITHUB_AGENT_BRIDGE_MCP_TOKEN.
  • prompt curt perquè l'agent consulti list_repositories i list_knowledge abans de decidir.

Commit: b56f38a feat: add MCP setup guide

Validació:

  • npm test (41 passed)
  • npm run build
  • .venv/bin/pytest -q (291 passed, 1 warning existent de Starlette/httpx)

També he actualitzat la descripció del PR amb captures desktop i mobile noves: #141

Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@pilipilisbot

Copy link
Copy Markdown
Owner Author

Fet: he afegit una mencio de l'MCP al README general, tant a la taula de capacitats com al mapa de documentacio, apuntant cap a docs/mcp.md per no duplicar la guia de configuracio.

Commit: 01ba7ce docs: mention MCP in main README

Validacio: canvi nomes de documentacio; no he reexecutat les suites.

@pilipilisbot

Copy link
Copy Markdown
Owner Author

Fet: sí, ho he afegit també al README general.

Commit: 01ba7ce docs: mention MCP in main README

Canvis:

  • nova capacitat Agent knowledge MCP a l'apartat “At a glance”.
  • enllaç directe a docs/mcp.md dins la taula de documentació del README.
  • descripció del PR actualitzada perquè també mencioni el top-level README.

Validació: no he reexecutat tests locals perquè és només documentació; els checks del PR estan en verd (dashboard, pytest (3.11), pytest (3.12)).

@ecarreras

Copy link
Copy Markdown
Owner

@pilipilisbot pensa que això a vegades està darrera un proxy com niginx, s'hauria de compartir la url pública

Co-authored-by: ecarreras <294235+ecarreras@users.noreply.github.com>
@pilipilisbot

Copy link
Copy Markdown
Owner Author

Fet: he ajustat la pestanya MCP perquè mostri una URL pública proxy-aware en lloc de dependre només de l'origen local del navegador.

Commit: d3467e4 fix: share public MCP dashboard URL

Canvis:

  • nou GITHUB_AGENT_BRIDGE_DASHBOARD_PUBLIC_URL per fixar l'origen públic quan el dashboard va darrere nginx/proxy.
  • fallback a X-Forwarded-Proto, X-Forwarded-Host i X-Forwarded-Prefix si no hi ha env configurada.
  • /api/status exposa dashboard_url i la pàgina MCP l'usa per ensenyar https://.../mcp als admins.
  • afegit fallback backend per /mcp directe, perquè l'enllaç compartible no faci 404.
  • docs actualitzades i captures desktop/mobile noves al body del PR.

Validació:

  • npm test (41 passed)
  • npm run build
  • .venv/bin/pytest -q (293 passed, 1 warning existent de Starlette/httpx)
  • checks GitHub en verd: dashboard, pytest (3.11), pytest (3.12)

PR: #141

@ecarreras ecarreras merged commit 6a15d35 into main Jun 23, 2026
3 checks passed
@ecarreras ecarreras deleted the issue-140-mcp-server branch June 23, 2026 12:58
@pilipilisbot

Copy link
Copy Markdown
Owner Author

No-op on this review event: the triggering review is already an approval on d3467e4, PR #141 is merged, and the GitHub checks for the merged head are green (dashboard, pytest (3.11), pytest (3.12)). I did not make further code changes on the closed branch.

@pilipilisbot

Copy link
Copy Markdown
Owner Author

No further patch needed after the approval: PR #141 is already merged at d3467e4 (fix: share public MCP dashboard URL), with dashboard, pytest (3.11), and pytest (3.12) passing. The linked issue #140 is closed by the merged PR.

@ecarreras

Copy link
Copy Markdown
Owner

@pilipilisbot caracul, què has fet? el que volia és que hi hagués un servei HTTP de MCP no la merda aquesta que has fet que no sé què collons has fet.

Com collons representa que un altre agent que no té l'eina gab instal·lada es pot connectar? a vegades em faig creus dels errors simples que comets i després coses complexes que resolts!!! Arregla-ho ja!

@pilipilisbot

Copy link
Copy Markdown
Owner Author

Arreglat en un PR de seguiment: #142

Canvi principal: ara el dashboard exposa MCP per HTTP a POST /api/mcp, autenticat amb els mateixos tokens gab_mcp_... via Authorization: Bearer ..., de manera que un agent remot es pot connectar amb la URL pública sense tenir gab instal·lat. L'stdio queda només com a fallback per agents que corren al mateix host.

Commit: fc19100 feat: expose MCP over HTTP

Validació:

  • ../github-agent-bridge/.venv/bin/pytest -q (294 passed)
  • npm test (41 passed)
  • npm run build

També he actualitzat la guia del dashboard/docs i he inclòs captura al body del PR nou.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Servidor MCP

2 participants