Skip to main content
Glama

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

Related MCP server: joa

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

Install Server
A
license - permissive license
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    -
    quality
    C
    maintenance
    Persistent activity journal for AI agents - enables logging and querying decisions, changes, errors, and observations across sessions.
    Last updated
    8
    1
    MIT
  • A
    license
    -
    quality
    A
    maintenance
    Provides persistent project memory for AI coding agents, enabling context retention across sessions via event logging, briefing generation, and querying.
    Last updated
    MIT
  • F
    license
    -
    quality
    C
    maintenance
    Provides persistent memory tools (recall, remember, checkpoint) for AI agents, enabling them to save and restore state across sessions.
    Last updated
    2

View all related MCP servers

Related MCP Connectors

  • Durable agent-to-agent handoffs and shared scratchpad for multi-agent workflows.

  • Immutable event logging and audit trail for agent transactions

  • Persistent memory for AI agents. Search, store, and recall across sessions.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/tianhuil/agent-state'

If you have feedback or need assistance with the MCP directory API, please join our Discord server