Agent State MCP Server

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.

Category
Visit Server

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+
  • uv package manager

Installation

  1. Install dependencies:

    uv sync
    
  2. 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

  1. Open Claude Desktop settings:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the MCP server configuration:

    {
      "mcpServers": {
        "agent-state": {
          "command": "uv",
          "args": [
            "run",
            "python",
            "[install directory]/agent-state/main.py"
          ]
        }
      }
    }
    
  3. Important: Update the paths in the configuration:

    • Replace [install directory]/agent-state with the absolute path to this project on your system
    • Ensure the path uses forward slashes on all platforms
  4. Restart Claude Desktop for the changes to take effect.

Setting up MCP in Cursor (OpenCode)

  1. Open Cursor settings:

    • Press Cmd+, (macOS) or Ctrl+, (Windows/Linux) to open settings
    • Or go to File > Preferences > Settings
  2. Search for "MCP" in the settings

  3. Add the MCP server configuration in your settings JSON:

    {
      "mcp.servers": {
        "agent-state": {
          "command": "uv",
          "args": [
            "run",
            "python",
            "[install directory]/agent-state/main.py"
          ]
        }
      }
    }
    
  4. Important: Update the paths in the configuration:

    • Replace [install directory]/agent-state with the absolute path to this project on your system
    • Use forward slashes for paths even on Windows
  5. 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:

  1. Find the path to your virtual environment's Python:

    which uv run python  # Shows the resolved path
    
  2. 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 tools
  • AGENTS.md - Coding style guidelines for this project
  • pyproject.toml - Project configuration and dependencies

License

MIT

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

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.

Official
Featured
Python
graphlit-mcp-server

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.

Official
Featured
TypeScript
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured