Expand description
A Model Context Protocol server on localhost, so AI assistants on the same Mac can use the library falcon has open.
It speaks Streamable HTTP on POST /mcp, and answers every request with a
single JSON object (no SSE stream, no sessions). [rpc] holds the JSON-RPC
layer and [tools] the tools.
Falcon’s own choices:
- it listens on 127.0.0.1 only and never binds Eagle’s port or 8000;
- a request is served only when its
Hostis the server’s own address and itsOrigin, if it has one, is on the loopback address. There are no CORS headers, so a web page can’t read an answer even from another local port; Options::tokencan also ask forAuthorization: Bearer <token>;- it serves whatever library
Handle::set_librarywas last given and has no way to open another one; - write tools exist only while
Options::allow_writesis on.
Structs§
- Handle
- A server running on its own threads; dropping it stops the server.
- Options
- What the app can change on a running server.
- Undo
Step - A write a tool made, for the app’s undo history.
Enums§
Constants§
- DEFAULT_
PORT - The first port tried. The HTTP API tries the five from
crate::DEFAULT_PORT, so this stays clear of them. - PATH
- The MCP endpoint.
- RESERVED_
PORT - A port the MCP server never binds, besides Eagle’s: other MCP servers on this Mac commonly sit there.
Functions§
- client_
config - The JSON an MCP client is configured with to reach this server.
- start
- Starts serving on the first free port of
ports, callingon_requestafter each handled request (for example to repaint a UI). Port 0 asks the system for a free port.