x-mcp
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@x-mcpGet my recent mentions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
x-mcp
x-mcp is an X API MCP server built in Node.js. It exposes dedicated MCP tools generated from the upstream X OpenAPI spec, keeps secrets in Vault, keeps non-secret configuration in Postgres, and enforces tenant-aware auth scope as tenant/user or tenant/account.
The scope model is tenant/user or tenant/account.
What It Does
Generates one
x_api_*MCP tool per documented X APIoperationIdExposes discovery tools for LLMs:
x_schema_discoveryandx_query_suggestionStores tenant-scoped app credentials and tenant/principal-scoped user credentials in Vault-backed profiles
Stores defaults, metadata, and non-secret runtime configuration in Postgres
Protects mutating tools with
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configuredSupports stdio, HTTP, or both MCP transports
Related MCP server: Swagger MCP Adapter
Runtime Layout
Key files:
src/config/env.js: environment parsing and validation
src/runtime/createRuntimeContext.js: shared runtime bootstrap
src/services/xInventory.js: generated inventory loading and search
src/services/xAuth.js: Vault/Postgres-backed credential profile storage and auth resolution
src/services/xApi.js: authenticated X API execution layer
src/mcp/server.js: MCP tool registration, mutation guards, and generated endpoint wiring
src/http/server.js: HTTP MCP transport with auth, limits, and access logging
Persistence model:
Vault stores actual secret values.
Postgres stores profile metadata, default profile selectors, and all non-secret config.
APP_NAMEis the single naming source for derived Vault paths and Postgres table names.
Generated Inventory
Committed artifacts:
Generate them with:
npm run inventory:generateCheck that the committed artifacts are current with:
npm run inventory:checkMCP Tool Families
All tools return JSON inside MCP text content.
Core tools:
x_connection_info: runtime, inventory, Vault, and Postgres connection metadatax_scope_info: resolve tenant/principal scope paths and persistence detailsx_health_check: validate Vault and Postgres connectivity for a selected scopex_schema_discovery: search the generated X endpoint inventoryx_query_suggestion: recommend a safe tool sequence for a workflow
Credential tools:
x_auth_upsert_app_credentialsx_auth_upsert_principal_credentialsx_auth_get_scope_credentialsx_auth_delete_profile
Config tools:
x_config_listx_config_getx_config_setx_config_delete
Generated X API tools:
one
x_api_*tool per OpenAPIoperationIdrich tool descriptions include use cases, auth prerequisites, parameter constraints, response shape, common failures, and safety warnings
Generic fallback:
x_api_request
Auth And Scope Model
App-scoped credentials are stored per tenant:
Vault path:
${APP_NAME}/tenants/<tenant>/x-api/app-profiles/<profileKey>Postgres key:
x.auth.app.profile.<profileKey>.meta
Principal-scoped credentials are stored per tenant principal:
Vault path:
${APP_NAME}/tenants/<tenant>/<users|accounts>/<principal>/x-api/profiles/<profileKey>Postgres key:
x.auth.principal.profile.<profileKey>.meta
Default selectors are stored in Postgres:
x.auth.app.defaultProfileKeyx.auth.principal.defaultProfileKey
Supported auth types:
bearer token
OAuth 2 user token
OAuth 1a user token
If MCP_ADMIN_AUTH_KEY is configured, every mutating tool requires authorizationKey, including generated mutating endpoint tools and mutating x_api_request calls.
Environment
See .env.example for the full set. The most important groups are:
POSTGRES_*VAULT_*MCP_*X_API_*
The default local scope is controlled by:
MCP_CONFIG_DEFAULT_TENANT_IDMCP_CONFIG_DEFAULT_USER_IDMCP_CONFIG_DEFAULT_ACCOUNT_IDMCP_CONFIG_DEFAULT_PRINCIPAL_TYPE
Local Development
Install dependencies and generate the inventory:
npm ci
npm run inventory:generateRun stdio:
npm run start:stdioRun HTTP:
npm run start:httpRun both:
npm run start:bothMCP Client Registration
VS Code example:
{
"command": "npm",
"args": ["run", "start:stdio"],
"cwd": "/Users/lesterjohn/Documents/GitHub/X-mcp"
}Claude Desktop example:
{
"mcpServers": {
"x-mcp": {
"command": "npm",
"args": ["run", "start:stdio"],
"cwd": "/Users/lesterjohn/Documents/GitHub/X-mcp"
}
}
}If you need HTTP transport, point the client at http://127.0.0.1:3000/mcp after starting npm run start:http.
Infrastructure
docker-compose.yml runs local Postgres, Vault, and the HTTP MCP service. It preserves Vault Raft persistence and runs vault-unseal-key-init before Vault starts.
External Services Mode
docker-compose.external.yml is the supported External Services Mode for existing Vault and Postgres infrastructure. It requires POSTGRES_HOST, POSTGRES_PORT, POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, VAULT_ADDR, and VAULT_TOKEN to be provided by the deployment environment.
initdb/001_config.sh creates ${APP_NAME}_config with tenant/principal primary keys.
Production Vault
vault-production/README.md covers migration from the local development Vault to the Raft-backed production layout used by x-mcp.
CI And Push Enforcement
GitHub Actions in .github/workflows/inventory-and-tests.yml regenerates the X API inventory, fails if artifacts are stale, uploads the generated inventory artifacts, and runs npm run verify.
The local pre-push hook in .githooks/pre-push also runs:
npm run verifyThis repository is configured to use .githooks as core.hooksPath.
Verification
Run the full verification path with:
npm run verifyThe test suite covers:
HTTP auth and transport behavior
generated X tool registration and mutation auth enforcement
discovery and query-suggestion behavior
Vault token indexing and fallback semantics
Vault production migration scaffolding
X inventory artifact presence and push/test enforcement
License
MIT. See LICENSE.
Maintenance
Related MCP Servers
- Alicense-qualityDmaintenanceTransforms OpenAPI specs into an MCP server, enabling dynamic API interaction through natural language with automatic authentication and endpoint discovery.Last updated131MIT
- AlicenseAqualityDmaintenanceA TypeScript-based MCP server that integrates with Swagger/OpenAPI specifications to expose API endpoints as tools for Large Language Models (LLMs), enabling natural language interaction with any OpenAPI-compliant API.Last updated49MIT
- Alicense-qualityBmaintenanceAn MCP server for API discovery and execution with a token-efficient search -> execute workflow over OpenAPI, Google Discovery, and optional native GraphQL and gRPC sources.Last updated10512Apache 2.0
- Alicense-qualityDmaintenanceA config-driven MCP server that exposes OData and REST APIs as MCP tools, enabling AI assistants to query, manage, and monitor SAP backends through natural language.Last updated7126MIT
Related MCP Connectors
MCP server for interacting with the Supabase platform
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for Argo RPG Platform — connects AI assistants to campaign data via OAuth2
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/LesterAJohn/X-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server