ExMCP.Server.DSL (ex_mcp v1.0.0-rc.0)
View SourceModern DSL for defining MCP server primitives next to their handlers.
Use this module with ExMCP.Server.Handler:
defmodule MyServer do
use ExMCP.Server.Handler
use ExMCP.Server.DSL
tool "echo", "Echo back the input" do
param :message, :string, required: true
run fn %{message: message}, _state ->
{:ok, %{text: message}}
end
end
end
Summary
Functions
Defines a prompt with a co-located renderer.
Defines a static resource with a co-located read handler.
Defines a resource template with a co-located read handler.
Defines a tool with a co-located handler.
Functions
Defines a prompt with a co-located renderer.
Defines a static resource with a co-located read handler.
Defines a resource template with a co-located read handler.
Defines a tool with a co-located handler.