Serve MCP over HTTP
Connect a script, test harness, or agent to OSMates over HTTP instead of starting osmates mcp.
Turn on MCP over HTTP
- Choose OSMates > Settings, then click Remote.
- Under This Mac, turn on Serve MCP over HTTP on this Mac.
In Terminal, run osmates remote set local on.
OSMates serves MCP at http://127.0.0.1:7330/mcp. Only programs on this Mac with a token can connect, not other computers or your machines. To stop serving and end every session, turn the switch off or run osmates remote set local off.
Make a token
- In Remote settings, under Tokens, click New Token.
- Name the token after its client.
- Under Tools, choose Read Only, Operator, or Full. See Pick a profile.
- Set an expiry if you want one, then click Make Token.
- Click Copy Token and paste it into the client's settings.
The token starts with osm_, works only on this Mac, and isn't shown again. Give each client its own.
To make one in Terminal, with Operator as the default profile and an expiry of 1 to 365 days:
osmates remote token create ci --profile operator --days 30
Connect a client
In a client that supports Streamable HTTP, enter the URL http://127.0.0.1:7330/mcp and the header Authorization: Bearer <token>. A client with a JSON configuration takes:
{
"mcpServers": {
"osmates": {
"type": "http",
"url": "http://127.0.0.1:7330/mcp",
"headers": { "Authorization": "Bearer <token>" }
}
}
}
The client gets the MCP tools its token's profile allows. You answer on this Mac before it uses a machine.
Disconnect a client
A session ends after 30 minutes without requests, or when its token expires. To disconnect a client now, revoke its token:
osmates remote connections
osmates remote token revoke ci
Limits
- A client can't open files on your Mac. Create or import machines from installation files in the app or with
osmates mcp. - To reach this Mac from a cloud MCP client, see Connect cloud MCP clients.