mcp-agent-session-summaries

mcp-agent-session-summaries

Let your OpenCode coding agent document agent sessions in a safe, sandboxed markdown folder.

Category
访问服务器

README

<h1 align="center">MCP Tool to Create Agent Session Summaries in a Specified Folder</h1>

<p align="center"> Let your OpenCode coding agent document agent sessions in a safe, sandboxed markdown folder. </p>

<p align="center"> <img src="https://img.shields.io/badge/Python-3.10+-3776AB?logo=python&logoColor=white" alt="Python 3.10+"> <img src="https://img.shields.io/badge/MCP%20Server-purple" alt="MCP Server"> <img src="https://img.shields.io/badge/License-MIT-yellowgreen" alt="MIT License"> <img src="https://img.shields.io/badge/OpenCode-ready-brightgreen" alt="OpenCode Ready"> <img src="https://img.shields.io/badge/version-0.1.0-blue" alt="Version 0.1.0"> </p>


Let your OpenCode coding agent document agent sessions in a safe, sandboxed markdown folder.

Add to your project's opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mcp-agent-session-summaries": {
      "type": "local",
      "command": [
        "python3",
        // Where the mcp-agent-session-summaries/server.py is located
        "/User/path/mcp-agent-session-summaries/server.py",
        // Your chosen documentation folder
        "/User/path/Documents/agent-session-documents"
      ],
      "enabled": true
    }
  }
}

This lets the agent manage the server lifecycle automatically.

What this is for

This MCP tool leverages your agent's LLM to document what happened during your current session.

Instead of relying on the agent's internal database or manually creating READMEs for each of your projects, you tell your agent to document a summary and it will save it your chosen markdown folder.

Ideas of what the agent can document:

  • Session summaries and conversation histories
  • System design decisions
  • Task executions and outcomes
  • Architecture decisions and tradeoffs
  • Engineering logs
  • Any context you want to capture from the session

Your chosen documentation folder becomes a living record of what your agents have done. It's goal is to contain human-readable markdown, ready to reference in the future.

Example:

After a long coding session, you tell your agent:

"Summarize this session and save it to my docs folder."

The agent uses the MCP tools to create and edit markdown files with all the details: Engineering decisions, system design, prompts that worked, architecture notes.

Over time you build a human-readable folder of every session's knowledge. No digging through OpenCode's internal database. No hunting for README files across your filesystem. Just a docs folder full of markdown, ready to reference at any time.


Why not just README files?

  • You'd have to manually create one for every project
  • You'd have to search your filesystem to find what you need
  • You'd lose context — you can only document what you remember after the fact

This server lets the agent use its current session context (everything you just did) to generate rich documentation at the moment it's fresh. Past sessions become reference docs you can point the agent back to later.


How it works

OpenCode starts this server as a background process when your agent session begins. The server exposes 9 tools over the Model Context Protocol. The agent decides when to call them based on what you ask.

┌──────────────┐   stdio (JSON-RPC)    ┌──────────────────────────┐
│              │   tools/list          │                          │
│  OpenCode    │ ───────────────────►  │  mcp-agent-session-summaries │
│              │   tools/call          │                          │
│              │ ◄──────────────────── │  9 tools for .md files   │
└──────────────┘                       └──────────────────────────┘

Design

These tools are named and described based on how LLMs select and use them:

  1. Tool names are the strongest signal — the doc_ prefix groups related tools so the model recognizes them as a documentation system, not generic file operations.

  2. Descriptions say WHEN to use the tool — vague descriptions make the LLM guess. Each tool's description tells the model exactly when it's the right choice.

  3. Write tools get explicit directivesdoc_create_file and doc_edit_file tell the model "ALWAYS use this for markdown documentation" and "do NOT write .md files directly." This prevents the model from writing documentation to the wrong folder.

  4. Tool descriptions are the only reliable channel — research shows agents consistently read tool names and descriptions, while other metadata types are frequently ignored. All usage guidance lives here.


Tools

Tool What it does Input
doc_read_file Read a session documentation file path
doc_read_multiple_files Read several documentation files at once paths (list)
doc_list_directory Browse the documentation folder structure path
doc_search_files Search for documentation files matching a pattern pattern, path
doc_get_file_info Get metadata about a documentation file path
doc_create_file Create a new session documentation file path, content
doc_edit_file Overwrite an existing documentation file path, content
doc_delete_file Delete a documentation file path
doc_create_directory Create a subfolder inside the documentation folder path

Requirements

  • Python 3.10 or newer
  • The mcp package: pip install mcp

Setup

Add to your project's opencode.jsonc:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "mcp-agent-session-summaries": {
      "type": "local",
      "command": [
        "python3",
        // Where the mcp-agent-session-summaries/server.py is located
        "/User/path/mcp-agent-session-summaries/server.py",
        // Your chosen documentation folder
        "/User/path/Documents/agent-session-documents"
      ],
      "enabled": true
    }
  }
}

Replace the two paths:

  • /full/path/to/server.py — where you saved server.py
  • /full/path/to/your/documents — the folder where you want session docs to accumulate

Example prompts

Once configured, just ask your agent naturally:

What you want Prompt
Log a session "Summarize everything we did this session and save it to sessions/2025-07-13-api-redesign.md"
Document design decisions "Create a markdown file documenting the system design decisions we made today in docs/design-decisions.md"
Engineering log "Update engineering-log.md with what we accomplished this session"
Architecture docs "Document the architecture of this project in docs/architecture.md"
Reference past work "Read sessions/2025-07-10-auth-flow.md and remind me what we decided about authentication"

Security: what it CAN'T do

  • Can't access files outside the documents folder — path traversal (../../etc/passwd) is rejected
  • Can't create non-markdown files — only .md extension is allowed for writes
  • Can't overwrite files by accidentcreate_markdown refuses if the file already exists
  • Can't read non-markdown filesread_file and read_multiple_files also require .md

Project structure

mcp-agent-session-summaries/
├── server.py         # The MCP server (all 9 tools)
├── pyproject.toml    # Python dependencies
└── README.md         # This file

Non-agent testing

This is for testing this tool outside your agent.

git clone https://github.com/chrisipanaque/mcp-agent-session-summaries
cd mcp-agent-session-summaries
python3 -m venv .venv
source .venv/bin/activate
pip install mcp
# create your documentation folder
mkdir -p /Documents/agent-coding-sessions
# point the tool to your documentation folder
python server.py /Documents/agent-coding-sessions

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选