NexusAPI MCP Server
Enables AI agents to interact with NexusAPI's asynchronous generation API, including model discovery, schema inspection, task creation, and status retrieval.
README
NexusAPI MCP server, Python, Node.js and n8n examples
An open-source MCP server and production-minded examples for the asynchronous NexusAPI generation flow.
MCP tools for AI agents
The stdio server exposes four tools:
nexusapi_list_models— search the live public model catalog;nexusapi_get_model_schema— inspect the live OpenAPI fields for one model;nexusapi_generate— create an asynchronous, potentially billable generation task;nexusapi_get_task— retrieve task status, result or error.
The server does not hide model-specific validation. Agents should inspect the live schema and obtain user approval before calling the billable generation tool.
After this repository is published, use it from a compatible local MCP host with:
{
"mcpServers": {
"nexusapi": {
"command": "npx",
"args": ["-y", "github:mat12121212/nexusapi-examples"],
"env": {
"NEXUS_API_KEY": "replace-me"
}
}
}
}
Requirements: Node.js 20+ and an existing NexusAPI key. The key remains in the local host environment; do not commit it to the repository.
The repository demonstrates one lifecycle shared by the model schemas published in the live NexusAPI OpenAPI document:
- Send
POST /generatewith aparamsobject. - Store the returned
task_id. - Poll
GET /tasks/{task_id}with bounded exponential backoff. - Stop on
completedorfailed.
The model-specific fields still come from the live schema. Do not copy parameters between models without checking the NexusAPI documentation and OpenAPI JSON.
Examples
src/mcp-server.mjs— local MCP server over stdio.python/nexusapi_client.py— reusable synchronous Python client.python/kling_video.py— Kling 3 text-to-video request.node/nexusapi-client.mjs— dependency-free Node.js 18+ client.node/gpt-image.mjs— GPT Image request.n8n/nexusapi-generate-and-wait.json— importable workflow with polling and failure handling.
Quick start: Python
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
export NEXUS_API_KEY="replace-me"
python python/kling_video.py
Quick start: Node.js
export NEXUS_API_KEY="replace-me"
node node/gpt-image.mjs
n8n
Import the JSON file from n8n/, then create the NEXUS_API_KEY environment variable in the n8n runtime. Review the model parameters before executing the workflow. A successful run can incur generation charges.
Safety notes
- Keep the API key on the server. Never ship it in browser JavaScript.
- A client timeout does not prove that a generation stopped. Save
task_idand check it again. - Do not retry an ambiguous
POST /generateautomatically: the first request may have created a paid task. - Treat
422as a request/schema problem. Change the request before retrying. - Respect
429and temporary5xxresponses with bounded backoff. - Review every agent-proposed generation before allowing the billable MCP tool call.
Verification
Verified against the live NexusAPI OpenAPI document and the official MCP TypeScript SDK v2 on 2026-08-01. The included smoke test performs the MCP initialize handshake, lists tools and calls all four tools against a local mock API. No paid generation is used by the test.
Disclosure
This repository is maintained for NexusAPI. The examples are open source under the MIT License; use of the API itself is governed by the service terms and pricing.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.