letta-mcp-agent-framework

ProfessorBone/letta-mcp-agent-framework

3.2

If you are the rightful owner of letta-mcp-agent-framework and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Letta-Integrated MCP Server & AI Agent Memory Framework is a comprehensive implementation designed to enhance AI agents with memory capabilities and seamless integration with development environments.

🧠 Letta-Integrated MCP Server & AI Agent Memory Framework

A comprehensive Model Context Protocol (MCP) server implementation that integrates Letta's agent memory capabilities with VS Code Agent Mode for building self-improving AI agents.

🎯 Overview

This project provides:

  • Custom MCP Server with Letta agent memory integration
  • GitHub MCP Integration for repository operations
  • Memory-Enhanced Agent Prompts for continuous learning
  • VS Code Agent Mode Configuration for seamless development

🚀 Quick Start

1. Clone the Repository

git clone https://github.com/YOUR_USERNAME/letta-mcp-agent-framework.git
cd letta-mcp-agent-framework

2. Setup Letta MCP Server

cd mcp_servers/letta_agent_mcp
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your configuration (see API Keys section below)
./start.sh

3. Configure VS Code

  1. Ensure VS Code has Agent Mode enabled
  2. Restart VS Code to load MCP configuration
  3. Start using memory-enhanced agent commands!

🔑 API Keys & Configuration

Get started immediately without any API keys! The framework includes a mock implementation that works out of the box.

Required for Full Features

  • Letta API Key - For real agent memory (when available)
  • OpenAI API Key - For GPT-4 integration
  • Anthropic API Key - For Claude integration
  • Google AI API Key - For Gemini integration

No Setup Required

  • GitHub Integration - Handled automatically by VS Code OAuth

📖 Complete setup guide: See for detailed instructions on obtaining and configuring all API keys.

🧰 Features

Memory Operations

# Store important context
/Letta.remember input:"User prefers detailed technical explanations"

# Recall relevant information  
/Letta.recall query:"What are the user's coding preferences?"

# Trigger reflection and analysis
/Letta.reflect task_type:"code_quality_analysis"

GitHub Integration

# List repository issues
/GitHub.listIssues owner:username repo:project state:open

# Create files and commits
/GitHub.createFile path:"src/component.js" content:"..."

📁 Project Structure

letta-mcp-agent-framework/
├── .vscode/
│   ├── settings.json         # VS Code MCP configuration
│   └── mcp.json             # MCP server registry
├── mcp_servers/
│   └── letta_agent_mcp/     # Custom Letta MCP server
│       ├── main.py          # FastAPI server implementation
│       ├── requirements.txt # Python dependencies
│       ├── .env.example     # Environment template
│       ├── start.sh         # Startup script
│       └── README.md        # Server documentation
├── agent_prompts.md         # Comprehensive prompt library
├── test_mcp_setup.py       # MCP configuration validator
└── README.md               # This file

🔧 Technical Details

MCP Servers Configured

  1. GitHub MCP Server (github)

    • OAuth integration with GitHub API
    • Repository operations and issue management
    • Full-scope access for development workflows
  2. Letta Agent MCP Server (letta-mcp)

    • Memory storage and retrieval
    • Agent reflection and analysis
    • Background task processing
    • Mock implementation for development

API Endpoints

Letta MCP Server (localhost:4000)
  • POST /remember - Store memory blocks
  • POST /recall - Query stored memories
  • POST /reflect - Trigger agent reflection
  • GET /status - Server statistics
Request/Response Examples
// Store Memory
POST /remember
{
  "input": "User prefers React functional components",
  "tags": ["preferences", "react", "coding-style"]
}

// Recall Memory  
POST /recall
{
  "query": "React component preferences",
  "limit": 5
}

🤖 Agent Capabilities

Self-Improving Workflows

  1. Context Preservation: Automatically store important decisions and context
  2. Pattern Recognition: Identify recurring themes and approaches
  3. Adaptive Learning: Improve responses based on interaction history
  4. Background Analysis: Continuous reflection and insight generation

Memory-Enhanced Development

  • Project Context: Remember technology stacks and architecture decisions
  • User Preferences: Adapt to coding styles and communication preferences
  • Problem Solutions: Recall previous approaches to similar challenges
  • Learning Patterns: Track knowledge gaps and improvement areas

🛠️ Development

Prerequisites

  • Python 3.8+
  • VS Code with Agent Mode enabled
  • Git for version control

Local Development

# Start the Letta MCP server
cd mcp_servers/letta_agent_mcp
python main.py

# Verify MCP configuration
python ../../test_mcp_setup.py

Adding Custom Tools

  1. Extend the LettaAgentManager class in main.py
  2. Add new Pydantic models for request/response
  3. Create FastAPI endpoints with proper error handling
  4. Update the agent prompt library

📚 Documentation

  • - 150+ examples for memory-enhanced agents
  • - Complete API documentation
  • Setup Guide - Installation and configuration

🔐 Security

  • OAuth Integration: GitHub authentication via VS Code's secure credential store
  • Local Server: Letta MCP server runs locally for data privacy
  • Environment Variables: Sensitive configuration isolated in .env files
  • CORS Configuration: Controlled cross-origin access

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the file for details.

🙏 Acknowledgments

  • Letta Framework - For agent memory and reasoning capabilities
  • Model Context Protocol - For standardized AI tool integration
  • VS Code Team - For Agent Mode and MCP support
  • FastAPI - For robust API server implementation

🔗 Related Projects


Built for the future of AI-powered development 🚀