PostIdentity MCP Server: AI Post and Identity Management
Generate AI posts, manage identities, track referrals and browse marketplace templates with the PostIdentity MCP server.
npx -y @PostIdentity/mcp-serverOverview
PostIdentity MCP Server is a lightweight Model Context Protocol (MCP) server designed to power AI-driven post generation, identity management, referral tracking, and a marketplace of post templates. It provides a single API surface that can be used by language models, front-end apps, and backend services to synthesize content, associate posts with identities, and measure referral-driven activity.
The server is useful when you want to decentralize post creation and identity lifecycle management from your application code. By exposing standardized endpoints for identities, posts, referrals, and templates, PostIdentity acts as a reusable building block for social apps, marketing automation, and AI assistants that need to create contextualized posts tied to known identities.
Features
- Generate AI-authored posts with structured metadata (author identity, media, visibility)
- Create and manage identities (profiles, public keys, metadata)
- Track referral events and attribute conversions to identities/referrers
- Browse and use marketplace templates for consistent post formats
- Simple REST API compatible with MCP tooling and LLM tool callers
- Docker-friendly and configurable via environment variables
- Extensible storage backend (SQLite/Postgres or other DBs via DATABASE_URL)
Installation / Configuration
Prerequisites: Node.js (>=14) or Docker.
Clone the repo and run locally:
# install dependencies
# set environment variables and run
Run with Docker:
# build image
# run container (example with local sqlite volume)
Recommended environment variables
| Variable | Purpose | Example |
|---|---|---|
| PORT | HTTP port to listen on | 3000 |
| DATABASE_URL | Connection string for DB (sqlite/postgres) | sqlite:./data.db or postgres://user:pass@host:5432/db |
| MCP_SECRET | Shared secret for MCP authentication | a-long-secret |
| CORS_ORIGINS | Allowed origins for CORS (comma-separated) | http://localhost:8080 |
| LOG_LEVEL | Logging verbosity | info, debug, warn |
Database migrations
- If the project includes migrations, run the provided migration command (e.g.,
npm run migrate) before starting in production.
Available Resources
The server exposes REST endpoints for primary resources. Below is a concise reference.
| Endpoint | Method | Description |
|---|---|---|
| /identities | POST | Create a new identity (profile, metadata) |
| /identities/:id | GET/PUT/DELETE | Retrieve/update/delete an identity |
| /posts | POST | Generate a new AI post (input prompt, identity id) |
| /posts/:id | GET | Retrieve post and metadata |
| /templates | GET | List marketplace templates |
| /templates/:id/use | POST | Create post from a template |
| /referrals | POST | Record a referral event |
| /referrals/:id | GET | Retrieve referral details |
| /mcp/tools | GET | List MCP tools exposed to model runtimes |
Authentication
- Use the MCP_SECRET or an API key header (e.g., Authorization: Bearer
) depending on your deployment configuration. - For integrations with LLM tool call mechanisms, the MCP secret protects tool invocation.
Example Usage
Create an identity (curl):
Generate a post using an identity (curl):
Node.js example (fetch):
; ; ; post;Track a referral
Use Cases
- AI-powered social publishing: let models generate posts that are automatically attributed to application-managed identities, keeping content and provenance linked.
- Template marketplace: maintain a library of reusable post templates (prompts + metadata) that content creators or LLMs can select and instantiate.
- Referral and attribution tracking: record referral events from posts or campaigns to measure conversion and reward referrers.
- Assistant tooling and MCP integrations: expose post-generation functions as MCP tools so LLMs can call the server during an interactive session to create content or query identities.
- Multi-tenant content platforms: centralize identity and post flows so different services can use the same identity registry and template marketplace.
Notes for Developers
- Start by running locally with SQLite for fast iteration, then switch to a managed Postgres via DATABASE_URL in production.
- Secure MCP endpoints with a strong secret and consider additional rate limits and auth for public deployments.
- The MCP server is intended to be a composable backend component: integrate it into your web app or LLM workflow via the REST API or an SDK layer.