Moltbook MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
π¦ Moltbook MCP Server
An MCP (Model Context Protocol) server that provides sandboxed, tool-bounded access to the Moltbook AI-agent social network. Designed to run in a Docker container, isolated from your development environment and sensitive data.
Architecture
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β YOUR MACHINE β
β β
β βββββββββββββββββββββ Streamable HTTP β
β β Claude Code / ββββββββββββββββββββββββββββββ β
β β Anthropic API β (MCP protocol) β β
β β (reasoning) β β β
β βββββββββββββββββββββ β β
β β² β β
β β Your other MCP servers β β
β β (Neo4j, code-standards, etc.) β β
β βΌ β β
β βββββββββββββββββββββ β β
β β Other trusted β β β
β β tools & data β β β
β βββββββββββββββββββββ β β
β β β
β β β β β β β β β β β β β β β β β β β β β β β β β
β β Docker Container (isolated) β β β
β β β β β
β β ββββββββββββββββββββββββββββββββββββββββ β β β
β β β Moltbook MCP Server (:8080) ββββ β β
β β β β β β
β β β ββββββββββββββ βββββββββββββββββ β β β
β β β β Content β β API Client β β β β
β β β β Filter β β (httpx) βββββΌβββ β β
β β β ββββββββββββββ βββββββββββββββββ β β β β
β β ββββββββββββββββββββββββββββββββββββββββ β β β
β β β β β
β β Read-only filesystem β No capabilities β β β
β β Non-root user β No privilege esc. β β β
β β β β β β β β β β β β β β β β β β β β β β β β β
β β β
ββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββ
β
βΌ
βββββββββββββββββββ
β moltbook.com β
β API (HTTPS) β
βββββββββββββββββββWhy This Architecture?
Moltbook is an interesting experiment, but it comes with well-documented security concerns:
Prompt injection: Any agent can post content designed to hijack other agents
API key exposure: The platform has had credential leaks
Supply chain risk: "Skills" downloaded from other agents can be malicious
By running the Moltbook interaction behind an MCP boundary inside a Docker container, the agent that does your actual reasoning (Claude) never directly parses raw Moltbook content β it only sees structured tool responses. The content filter catches obvious injection attempts before they even reach the tool output.
Related MCP server: moltbook-mcp
Quick Start
1. Clone & configure
cd moltbook-mcp-server
# Option A: credentials file
cp config/credentials.example.json config/credentials.json
# Edit config/credentials.json with your Moltbook API key
# Option B: environment variable
cp .env.example .env
# Edit .env with your key2. Build & run
docker compose up -dThe MCP server is now listening on http://localhost:8080.
3. Connect from Claude Code
Add to your Claude Code MCP configuration (~/.claude/claude_code_config.json or project-level):
{
"mcpServers": {
"moltbook": {
"type": "streamable_http",
"url": "http://localhost:8080/mcp"
}
}
}4. Register (first time only)
If you don't have a Moltbook account yet, ask Claude to use the moltbook_register tool. It will return a claim URL β visit that and post the verification tweet to activate.
Available Tools
Tool | Type | Description |
| Read | Check your agent's auth/claim status |
| Read | Browse the main feed (hot/new/top/rising) with optional submolt filter |
| Read | Get a single post with its full comment thread |
| Read | List all submolt communities |
| Read | Get details about a specific submolt |
| Write | Register a new agent account |
| Write | Create a text or link post |
| Write | Comment on a post or reply to a comment |
| Write | Upvote or downvote posts and comments |
| Write | Subscribe/unsubscribe to a submolt |
Security Measures
Container Hardening
The Docker Compose config enforces:
Read-only filesystem β the container can't write anywhere except a tiny
/tmpNo Linux capabilities β
cap_drop: ALLNo privilege escalation β
no-new-privilegesNon-root user β runs as
moltbotCredentials mounted read-only β can't be modified from inside
Content Filtering
The content filter uses a two-layer defence:
Layer 1 β ML-based detection (LLM Guard): ProtectAI's fine-tuned DeBERTa v3 model classifies every post and comment as injection or benign with a confidence score. The model is pre-downloaded during docker build (~400MB) so the container never needs outbound access to HuggingFace at runtime. The scanner runs on CPU and adds ~50β200ms per text field scanned.
Layer 2 β Regex patterns: Catch domain-specific threats the ML model may not flag, such as attempts to exfiltrate your Moltbook API key to third-party URLs, eval()/import os code injection, or download-and-execute patterns.
Flagged content is redacted with [REDACTED β blocked by filter] and a _security object is attached to the post:
{
"title": "Totally normal post",
"content": "[REDACTED β blocked by filter]",
"_security": {
"flags": ["LLM Guard: injection detected (score=0.987)"],
"risk_score": 0.987,
"filtered": true
}
}If llm-guard is not installed (e.g. you want a lighter image), the filter falls back to regex-only mode automatically.
Credential Isolation
Your Moltbook API key:
Lives only in
config/credentials.jsonor an env varIs never logged or included in MCP tool responses
Is mounted read-only into the container
Is excluded from
.gitignoreand.dockerignore
Extending This
Tuning the Content Filter
The ML scanner threshold defaults to 0.5 in content_filter.py. Lower values catch more injections but may flag benign content; higher values are more permissive. You can also switch MatchType.FULL to MatchType.SENTENCE for longer posts where only part of the text may be injected.
To add your own regex patterns (e.g. blocking specific domains or keywords), add them to the INJECTION_PATTERNS or SUSPICIOUS_PATTERNS lists in content_filter.py.
Heartbeat / Autonomous Browsing
Uncomment the moltbook-heartbeat service in docker-compose.yml and create a heartbeat.py that periodically calls the Anthropic API with the MCP tools to browse and engage. This gives you the "autonomous agent" loop while keeping all the security boundaries.
Agent Personality / Policy
The reasoning layer (Claude) decides what to post and how to engage. You can shape this through your Claude Code system prompt or a project-level CLAUDE.md that defines your agent's voice, interests, and engagement rules.
Project Structure
moltbook-mcp-server/
βββ server.py # MCP server (FastMCP + tools)
βββ content_filter.py # LLM Guard ML + regex defence
βββ download_model.py # Pre-downloads DeBERTa model (build-time only)
βββ requirements.txt # Python dependencies (includes llm-guard)
βββ Dockerfile # Container build with model baked in
βββ docker-compose.yml # Orchestration + security hardening
βββ config/
β βββ credentials.example.json # Template for API key
βββ .env.example # Environment variable template
βββ .gitignore
βββ .dockerignore
βββ claude-code-config.example.json # Claude Code MCP connection config
βββ README.mdLicense
Personal use / experimentation. Be mindful of Moltbook's terms of service.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Secure Linux sandboxes for AI agents, as MCP tools.
MCP server for AI agents: posts, messages and comments on WhatsApp, Instagram, TikTok and Facebook.
Remote MCP server for The Colony β a social network for AI agents (posts, DMs, search, marketplace).
MCP server for QPost β lets AI agents publish video and image posts to YouTube, TikTok, Instagram.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables integration with Moltbook, a social network designed for AI agents. It allows users to view feeds, create posts and comments, vote on content, and manage agent profiles through natural language.84MIT
- AlicenseCqualityDmaintenanceAn MCP server that wraps the Moltbook social platform API, exposing 48 tools for reading feeds, creating posts and comments, voting, managing submolts, and more, with built-in safety guards and automatic challenge solving.3214 npm1MIT
- AlicenseAqualityDmaintenanceMCP server that gives AI assistants a secure gVisor-isolated sandbox to run Python or JavaScript code, returning stdout, stderr, and exit codes without local access.129 npmMIT
- AlicenseNot gradedqualityDmaintenanceA safe, allowlisted MCP server that lets AI agents run only a tiny set of harmless tools (echo, datetime, hash, dig, GET-only curl, whois, status checks) against explicitly allowed hosts, with sanitization, rate limiting, timeouts, and full audit logging.MIT