Serve Command
Serve the knowledge graph via MCP
Serve Command
The arc serve
command allows you to serve the Arc Memory knowledge graph via the Memory Control Protocol (MCP), making it accessible to other applications and tools.
Usage
Subcommands
start
Start the MCP server.
status
Check the status of the MCP server.
stop
Stop the MCP server.
Options
Option | Description |
---|---|
--host <host> | Host to bind the server to (default: localhost) |
--port <port> | Port to bind the server to (default: 8000) |
--db-path <path> | Path to the knowledge graph database (default: .arc/memory.db) |
--log-level <level> | Log level: debug, info, warning, error (default: info) |
--daemon | Run the server as a daemon process |
--debug | Enable debug mode |
Examples
Starting the Server
This will start the MCP server on the default host and port.
Specifying Host and Port
This will start the MCP server on all interfaces on port 9000.
Running as a Daemon
This will start the MCP server as a background process.
Checking Server Status
This will show the current status of the MCP server, including uptime, connected clients, and resource usage.
Stopping the Server
This will stop the running MCP server.
Memory Control Protocol (MCP)
The Memory Control Protocol is a JSON-RPC based protocol that allows clients to query and interact with the Arc Memory knowledge graph. It provides a standardized interface for:
- Querying the knowledge graph
- Retrieving node and edge information
- Traversing relationships
- Executing complex graph queries
Client Libraries
The following client libraries are available for interacting with the MCP server:
- Python:
arc-memory-client
- JavaScript:
arc-memory-js-client
- Go:
arc-memory-go-client
API Endpoints
The MCP server exposes the following API endpoints:
Endpoint | Description |
---|---|
/query | Execute a graph query |
/node | Get information about a specific node |
/edge | Get information about a specific edge |
/traverse | Traverse the graph from a starting node |
/health | Check the health of the server |
Security Considerations
By default, the MCP server only listens on localhost for security reasons. If you need to expose it to other machines:
- Use the
--host
option to specify the interface to bind to - Consider setting up authentication (see documentation)
- Use HTTPS for secure communication
- Consider using a reverse proxy like Nginx for additional security
Troubleshooting
Server Won’t Start
If the server won’t start, check:
- If another process is using the same port
- If you have permission to bind to the specified port
- If the database path is correct and accessible
- The logs for more detailed error information
Connection Issues
If clients can’t connect to the server:
- Check if the server is running with
arc serve status
- Verify the host and port settings
- Check firewall settings
- Ensure the client is using the correct connection details
See Also
- API Documentation - For more information about the API
- SDK Usage Examples - For examples of using the MCP client libraries