Skip to main content

Module mcp

Module mcp 

Source
Expand description

jev as an MCP server: the one-shot commands, offered to an agent as tools.

This half is pure — a JSON-RPC message in, a JSON-RPC message out — so the protocol can be tested without a pipe. Everything that touches the network goes through Host::ask, which the caller supplies; crate::serve is the part that puts it on stdin and stdout.

Structs§

Host
What the host does for the tools that need more than text: send a request, price it, name a model.
Sent
What the host got back from one send: the answers jev eval scores, plus the raw body when there was one, so jev_ask can hand it over for a script to read.
ToolResult
What a tool call comes back with: text, and whether it describes a failure.

Constants§

INVALID_PARAMS
INVALID_REQUEST
KNOWN_PROTOCOLS
Revisions a client may ask for and still be understood; anything else gets ours back.
METHOD_NOT_FOUND
PARSE_ERROR
JSON-RPC error codes, the ones this server can actually raise.
PROTOCOL_VERSION
The protocol revision this server speaks.
SERVER_NAME
The name the server reports at initialize, and the prefix on every tool.

Functions§

call
Run one tool. Argument problems come back as an error result, not as a JSON-RPC failure.
handle
Answer one JSON-RPC message.
handle_line
One line of stdio: parse it, answer it, hand back the line to write — or nothing.
tools
Every tool this server offers, in the order an agent should reach for them.

Type Aliases§

Ask
Send one session and come back with its answers, or with why it did not.