MCP servers¶
asksh can connect to external Model Context Protocol (MCP) servers over stdio or Streamable http (2025-03-26 protocol version) and expose their tools to the model.
Configuration¶
Add one or more [[mcp_servers]] blocks to ~/.config/asksh/config.toml:
stdioservers: spawn as a subprocess withenvmerged over the current process environment, communicating via newline-delimited JSON-RPC 2.0. On shutdown,askshcloses stdin and waits up to 2 seconds before killing the process.httpservers: send JSON-RPC 2.0POSTrequests tourl(acceptingapplication/jsonandtext/event-streamSSE responses up to 16 MB) and forward anyMcp-Session-Idheader returned by the server.
All configured servers connect concurrently at startup with a 10-second timeout. If one server fails to start or list tools, asksh prints a warning to stderr and continues with the remaining servers and built-in tools.
Tool naming and permissions¶
Every MCP tool is registered as mcp__<server>__<tool> and marked as non-read-only so asksh checks permissions.toml before calling it.
Use MCP(...) rules in permissions.toml to allow or deny whole servers or individual tools:
See Permissions for rule precedence and [targets.<env>] overrides.