Current section
Files
Jump to
Current section
Files
lib/extools/mcp_server.ex
defmodule Extools.MCPServer do
@moduledoc """
The Extools MCP server definition.
Uses `Hermes.Server` to expose 12 live-runtime tools over the MCP
Streamable HTTP transport. The same module backs both the Phoenix Plug
mode (forwarded from `Extools`) and the standalone Bandit mode.
On init it installs `Extools.LogHandler` so `get_logs` has a live buffer.
"""
use Hermes.Server,
name: "Extools",
version: "0.1.1",
capabilities: [:tools]
alias Extools.Tools.{
ConfigDump,
EtsInspect,
ExecuteSqlQuery,
GetAppState,
GetDocs,
GetEctoSchemas,
GetLogs,
GetProcessInfo,
GetSourceLocation,
ProjectEval,
SupervisionTree,
TraceFunction
}
component(ProjectEval)
component(ExecuteSqlQuery)
component(GetLogs)
component(GetDocs)
component(GetSourceLocation)
component(GetEctoSchemas)
component(GetProcessInfo)
component(GetAppState)
component(EtsInspect)
component(SupervisionTree)
component(TraceFunction)
component(ConfigDump)
@impl Hermes.Server
def init(_client_info, frame) do
Extools.LogHandler.install()
{:ok, frame}
end
end