Files
Matt GodboltandClaude Opus 4.6 c974bb9af7 Add built-in MCP endpoint for LLM tool integration
Expose Compiler Explorer's compile, list, shortlink and asm-docs APIs via
a Model Context Protocol (MCP) endpoint mounted at /mcp. This lets
MCP-aware clients (Claude, etc.) drive CE directly as a tool, including:

- compile: compile source and return assembly / stdout / stderr, with
  optional execution
- list_languages / list_compilers / list_libraries
- generate_short_url / get_shortlink_info: round-trip CE shortlinks,
  returning full URLs derived from the incoming request
- lookup_asm_instruction: query the asm-docs database

Implementation:
- New lib/mcp/ module wiring @modelcontextprotocol/sdk into the existing
  Express router via StreamableHTTPServerTransport
- Refactor StorageBase static helpers (encodeBuffer, isCleanText,
  getSafeHash) to module-level functions so MCP tools can build shortlink
  hashes without instantiating a storage backend
- Expose ApiHandler.compileHandler and split out getAvailableLanguages()
  so MCP can reuse the same code paths the REST API uses

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-24 11:05:17 -04:00
..
2026-03-21 21:21:40 +01:00
2025-07-28 10:34:46 -05:00
2025-07-28 10:34:46 -05:00
2026-03-21 21:21:40 +01:00