Agent State MCP Server
Provides state and log management tools designed for long-lived AI agents that may be interrupted and resumed. It enables tracking agent progress and maintaining an append-only event history to ensure continuity across multiple sessions.
README
Agent State MCP Server
A Model Context Protocol (MCP) server built with FastMCP that provides agent state and log management tools for long-lived agents that may be interrupted and resumed.
Features
- State management tools for tracking agent progress
- Log management tools for maintaining append-only event history
- Built with FastMCP for easy MCP server development
- Type-safe Python code with proper type hints
Setup
Prerequisites
- Python 3.14+
uvpackage manager
Installation
-
Install dependencies:
uv sync -
Activate the virtual environment (if needed):
source .venv/bin/activate # On macOS/Linux # or .venv\Scripts\activate # On Windows
Running the Server
Run the MCP server:
uv run python main.py
Setting up MCP in Claude Desktop
-
Open Claude Desktop settings:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the MCP server configuration:
{ "mcpServers": { "agent-state": { "command": "uv", "args": [ "run", "python", "[install directory]/agent-state/main.py" ] } } } -
Important: Update the paths in the configuration:
- Replace
[install directory]/agent-statewith the absolute path to this project on your system - Ensure the path uses forward slashes on all platforms
- Replace
-
Restart Claude Desktop for the changes to take effect.
Setting up MCP in Cursor (OpenCode)
-
Open Cursor settings:
- Press
Cmd+,(macOS) orCtrl+,(Windows/Linux) to open settings - Or go to
File > Preferences > Settings
- Press
-
Search for "MCP" in the settings
-
Add the MCP server configuration in your settings JSON:
{ "mcp.servers": { "agent-state": { "command": "uv", "args": [ "run", "python", "[install directory]/agent-state/main.py" ] } } } -
Important: Update the paths in the configuration:
- Replace
[install directory]/agent-statewith the absolute path to this project on your system - Use forward slashes for paths even on Windows
- Replace
-
Restart Cursor for the changes to take effect.
Alternative: Using the virtual environment directly
If you prefer to use the virtual environment's Python directly:
-
Find the path to your virtual environment's Python:
which uv run python # Shows the resolved path -
Use that path in your MCP configuration instead of
uv run python.
Development
Code Quality
-
Run linting:
uv run ruff check . -
Run type checking:
uv run pyright -
Format code:
uv run ruff format .
Project Structure
main.py- Main MCP server with agent state and log management toolsAGENTS.md- Coding style guidelines for this projectpyproject.toml- Project configuration and dependencies
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.