A comprehensive Model Context Protocol (MCP) server that enables LLMs like Claude to explore and interact with the existing Fediverse through standardized MCP tools, resources, and prompts.
- π Fediverse Client: Interact with existing ActivityPub servers (Mastodon, Pleroma, Misskey, etc.)
- π WebFinger Discovery: Find and discover actors across the fediverse
- π€ MCP Protocol: Complete MCP server with resources, tools, and prompts
- π§ LLM-Optimized: Designed specifically for LLM interaction patterns
- π TypeScript: Fully typed with modern TypeScript and ESM
- β‘ High Performance: Efficient resource management and caching
- π Secure: Built-in security features and input validation
- β Remote Actor Discovery: Find users on any fediverse instance
- β Timeline Fetching: Get posts from any user's timeline
- β Instance Discovery: Find and explore fediverse instances
- β Instance Information: Get detailed info about any server
- β Search Capabilities: Search for content across instances
- β WebFinger Support: Resolve actor identifiers across the network
- β Multi-Platform Support: Works with Mastodon, Pleroma, Misskey, and more
- β Follower/Following Lists: Access social connections
- π Resources: Access remote ActivityPub data (actors, timelines, instance info)
- π§ Tools: Discover and interact with fediverse content
- π¬ Prompts: Templates for fediverse exploration and discovery
- π Completions: Context-aware argument completion
- π― Sampling: LLM integration for content discovery
- π Monitoring: Built-in logging and performance metrics
- Node.js 18+ (LTS recommended)
- npm or yarn package manager
- Git for cloning the repository
This project works on Windows, macOS, and Linux with automatic platform detection and appropriate script selection.
For the fastest setup, use our automated installation script:
# Install directly with npx (recommended)
npx activitypub-mcp install
# Or clone and run setup
git clone https://github.com/cameronrye/activitypub-mcp.git
cd activitypub-mcp
npm run setup
Windows (PowerShell):
# Clone and setup
git clone https://github.com/cameronrye/activitypub-mcp.git
cd activitypub-mcp
npm run setup:windows
# Or run PowerShell script directly
.\scripts\setup.ps1
macOS/Linux (Bash):
# Clone and setup
git clone https://github.com/cameronrye/activitypub-mcp.git
cd activitypub-mcp
npm run setup:unix
# Or run bash script directly
bash scripts/setup.sh
- Clone and install dependencies:
git clone https://github.com/cameronrye/activitypub-mcp.git
cd activitypub-mcp
npm install
- Configure environment:
Windows:
# Copy environment template
copy .env.example .env
# Edit configuration (optional)
notepad .env
macOS/Linux:
# Copy environment template
cp .env.example .env
# Edit configuration (optional)
nano .env
- Start the MCP server:
# Start the MCP server (no local ActivityPub server needed)
npm run mcp
Test MCP server with MCP Inspector:
# Install MCP Inspector
npm install -g @modelcontextprotocol/inspector
# Connect to the MCP server
mcp-inspector
To use this MCP server with Claude Desktop:
-
Locate your Claude Desktop config file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
-
Add the server configuration:
{
"mcpServers": {
"activitypub": {
"command": "npx",
"args": ["-y", "activitypub-mcp"]
}
}
}
- Restart Claude Desktop to load the new server.
For detailed usage instructions, examples, and troubleshooting, see:
- π Usage Guide - Comprehensive usage documentation
- π§ͺ Examples - Practical examples and integration patterns
- π§ API Reference - Complete API documentation (below)
Resources provide read-only access to fediverse data from any ActivityPub server. All resources return JSON data unless otherwise specified.
Get information about any actor in the fediverse:
activitypub://remote-actor/{identifier}
Parameters:
identifier
(string): The actor's fediverse handle (e.g., [email protected])
Example Response:
{
"@context": ["https://www.w3.org/ns/activitystreams"],
"id": "https://mastodon.social/users/alice",
"type": "Person",
"preferredUsername": "alice",
"name": "Alice Smith",
"summary": "Software developer passionate about decentralized social networks",
"inbox": "https://mastodon.social/users/alice/inbox",
"outbox": "https://mastodon.social/users/alice/outbox"
}
Access any actor's timeline/outbox from across the fediverse:
activitypub://remote-timeline/{identifier}
Parameters:
identifier
(string): The actor's fediverse handle (e.g., [email protected])
Example Response:
{
"@context": "https://www.w3.org/ns/activitystreams",
"type": "OrderedCollection",
"id": "https://mastodon.social/users/alice/outbox",
"totalItems": 42,
"orderedItems": [...]
}
Get information about any fediverse instance:
activitypub://instance-info/{domain}
Parameters:
domain
(string): The instance domain (e.g., mastodon.social)
Example Response:
{
"domain": "mastodon.social",
"software": "mastodon",
"version": "4.2.1",
"description": "The original server operated by the Mastodon gGmbH non-profit",
"registrations": true,
"stats": {
"user_count": 900000,
"status_count": 50000000
}
}
Access follower and following lists from any actor:
activitypub://remote-followers/{identifier}
activitypub://remote-following/{identifier}
Tools enable LLMs to discover and interact with the fediverse. All tools return structured responses with success/error information.
Discover and get information about any actor in the fediverse:
{
"name": "discover-actor",
"arguments": {
"identifier": "[email protected]"
}
}
Parameters:
identifier
(string, required): Fediverse handle (e.g., [email protected])
Fetch recent posts from any actor's timeline:
{
"name": "fetch-timeline",
"arguments": {
"identifier": "[email protected]",
"limit": 20
}
}
Parameters:
identifier
(string, required): Fediverse handlelimit
(number, optional): Number of posts to fetch (1-50, default: 20)
Get detailed information about any fediverse instance:
{
"name": "get-instance-info",
"arguments": {
"domain": "mastodon.social"
}
}
Parameters:
domain
(string, required): Instance domain
Search for content on a specific fediverse instance:
{
"name": "search-instance",
"arguments": {
"domain": "mastodon.social",
"query": "typescript",
"type": "accounts"
}
}
Parameters:
domain
(string, required): Instance domain to searchquery
(string, required): Search querytype
(string, optional): Type of content ("accounts", "statuses", "hashtags")
Find popular fediverse instances by category or topic:
{
"name": "discover-instances",
"arguments": {
"category": "mastodon",
"topic": "technology",
"size": "medium"
}
}
Parameters:
category
(string, optional): Software type ("mastodon", "pleroma", "misskey", etc.)topic
(string, optional): Topic or interest to search forsize
(string, optional): Instance size ("small", "medium", "large")region
(string, optional): Geographic region or languagebeginnerFriendly
(boolean, optional): Show only beginner-friendly instances
Get personalized instance recommendations based on interests:
{
"name": "recommend-instances",
"arguments": {
"interests": ["technology", "programming", "open source"]
}
}
Parameters:
interests
(array, required): List of your interests or topics
{
"name": "explore-fediverse",
"arguments": {
"interests": "technology and programming",
"instanceType": "mastodon"
}
}
{
"name": "compare-instances",
"arguments": {
"instances": "mastodon.social, fosstodon.org, hachyderm.io",
"criteria": "community size and focus"
}
}
{
"name": "discover-content",
"arguments": {
"topic": "artificial intelligence",
"contentType": "people"
}
}
activitypub-mcp/
βββ src/ # Source code
β βββ mcp-main.ts # MCP server entry point
β βββ mcp-server.ts # MCP server implementation
β βββ webfinger.ts # WebFinger discovery client
β βββ remote-client.ts # Remote ActivityPub client
β βββ instance-discovery.ts # Instance discovery service
β βββ health-check.ts # Health monitoring
β βββ performance-monitor.ts # Performance tracking
β βββ config.ts # Configuration constants
β βββ logging.ts # Logging configuration
βββ docs/ # Documentation
β βββ setup/ # Installation & configuration guides
β βββ guides/ # User guides & examples
β βββ development/ # Development documentation
β βββ specifications/ # Protocol specifications
βββ scripts/ # Installation & setup scripts
βββ tests/ # Test files
βββ dist/ # Built JavaScript files
βββ package.json # Dependencies and scripts
βββ README.md # This file
- WebFinger: Actor discovery across the fediverse
- MCP SDK: Model Context Protocol implementation
- ActivityPub: Decentralized social networking protocol
- LogTape: Structured logging
- TypeScript: Type-safe development
LLM Client ββ MCP Protocol ββ Fediverse Client ββ Remote ActivityPub Servers
β
WebFinger Discovery
β
Remote Data Fetching
Comprehensive documentation is available in the docs/
directory:
- Setup & Installation - Configuration and installation guides
- User Guides - Usage examples and tutorials
- Development - Development setup and best practices
- Specifications - ActivityPub and protocol specifications
See the Documentation Index for a complete overview.
npm run mcp
- Start MCP servernpm run mcp:dev
- Start MCP server in watch modenpm run test
- Run testsnpm run build
- Build TypeScript
Create a .env
file:
# MCP Server configuration
MCP_SERVER_NAME=activitypub-mcp
MCP_SERVER_VERSION=1.0.0
# Rate limiting
RATE_LIMIT_ENABLED=true
RATE_LIMIT_MAX=100
RATE_LIMIT_WINDOW=900000
# Logging
LOG_LEVEL=info
# Test MCP server with inspector
mcp-inspector
# Test fediverse interactions
npm run test
# Manual testing with specific actors
# Use the discover-actor tool to test WebFinger discovery
This project is designed to work seamlessly across different operating systems:
- Windows 10/11 (PowerShell, Command Prompt, Git Bash)
- macOS (Bash, Zsh)
- Linux (Bash, most distributions)
- Automatic script detection: npm scripts automatically choose the right script for your platform
- Native path handling: Proper configuration paths for each platform
- Shell compatibility: Both PowerShell (.ps1) and Bash (.sh) scripts provided
Platform | Recommended Method | Alternative Methods |
---|---|---|
Windows | npm run setup |
.\scripts\setup.ps1 or npm run setup:windows |
macOS | npm run setup |
bash scripts/setup.sh or npm run setup:unix |
Linux | npm run setup |
bash scripts/setup.sh or npm run setup:unix |
Windows PowerShell Execution Policy:
# If you get execution policy errors, run:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Windows Git Bash:
# Git Bash users can use Unix-style commands:
npm run setup:unix
Linux/macOS Permissions:
# If you get permission errors, make scripts executable:
chmod +x scripts/*.sh
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Fedify - ActivityPub server framework
- Model Context Protocol - LLM integration standard
- ActivityPub - W3C decentralized social networking protocol
Made with β€οΈ by Cameron Rye