nan-mcp-server
v1.5.0MCP server exposing NaN API tools: image generation (flux-2-klein, qwen-image-2.1) and editing (flux-2-klein), TTS (kokoro), STT (whisper), embeddings and…
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
generate_image Generate Image
Generate an image from a text prompt with flux-2-klein (default) or qwen-image-2.1 (NaN API). qwen-image-2.1 is text-to-image only and renders text inside the image more cleanly; use edit_image when you already have reference images to transform. Saves each image under NAN_OUTPUT_DIR (default ~/nan-mcp-output) and never overwrites: a taken name gets -2, -3, and so on. Returns the saved path and the temporary source URL. Counts against the account image quota (100/month, shared by both image models).
| Parameter | Type | Description |
|---|---|---|
prompt * | string | Textual description of the image to generate |
guidance | number | FLUX guidance scale (flux-2-klein only) |
model | string | Image model: "flux-2-klein" (default; text to image) or "qwen-image-2.1" (text to image with cleaner text rendering; 512-1280 px, seed 0-2147483647, no guidance) |
n | integer | Number of images to generate (1-4). Default 1. Each one counts against the monthly quota |
outputName | string | Optional base name for the output file(s). Sanitised to a safe filename; an existing name is never overwritten |
seed | number | Base seed for reproducibility. qwen-image-2.1 requires an integer from 0 to 2147483647 |
size | string | Image size "WxH" divisible by 16, e.g. 1024x1024, 1536x1024, 1024x1536. flux-2-klein: 256-1536 px per side; qwen-image-2.1: 512-1280 px per side. Aspect ratio 1:3-3:1. Default 1024x1024 |
list_voices List Voices
List the kokoro voice ids that text_to_speech accepts, grouped by language. Answered from the catalog bundled with the server, so it costs no API call and takes no arguments.
text_to_speech Text To Speech
Synthesize speech from text with kokoro (NaN API TTS); speech_to_text does the opposite. Call list_voices first to pick a voice id. Writes the audio under NAN_OUTPUT_DIR (default ~/nan-mcp-output) without overwriting anything, and returns the saved path and its size in bytes.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text to synthesize |
format | string | Audio format. Default mp3 |
outputName | string | Optional base name for the output file |
speed | number | Speech speed. Default 1.0 |
voice | string | Voice to use, e.g. "af_heart" (American English female), "ef_dora" (Spanish female), "em_alex" (Spanish male), "em_santa" (Spanish male). Use list_voices for the full catalog |
speech_to_text Speech To Text
Transcribe a local audio file with whisper (NaN API STT); text_to_speech does the opposite. The file must exist on this machine and stay under 25MB and about 2 minutes, or the request times out. Returns the plain transcript, or the full JSON with per-segment timings when verbose is set. Writes nothing to disk.
| Parameter | Type | Description |
|---|---|---|
file * | string | Absolute path to the audio file to transcribe |
language | string | ISO-639-1 language code, e.g. "es", "en". Auto-detected if omitted |
verbose | boolean | Return verbose JSON with segments instead of plain text |
list_models List Models
List the NaN API model ids the configured key can reach, one per line with its owner. Useful to confirm access or spot a retired model before calling another tool.
get_quota Get Quota
Report the legacy per-model token quota from the NaN dashboard backend (GET /api/usage/quota): used, cap, remaining and reset date, worst-utilised model first. Since NaN moved to a credit pool these counters can be frozen, and a line is flagged when its counter lags behind real activity; use get_usage for real consumption and the credit balance. Read-only and free. Undocumented route that accepts the same sk- key; it may change without notice.
get_usage Get Usage
Report real consumption and the credit pool from NaN (GET /v1/usage): credits used, remaining and reset date, then per-model requests, input/output/cached tokens and credits, with totals. Defaults to the current credit period. Prefer this over get_quota, whose counters can be stale. Read-only and free. Undocumented endpoint that accepts the same sk- key; it may change without notice.
| Parameter | Type | Description |
|---|---|---|
end_date | string | Last day, YYYY-MM-DD. Default: today |
start_date | string | First day, YYYY-MM-DD. Default: start of the current credit period |
embed_text Embed Text
Turn text into 4096-dimension vectors with qwen3-embedding (NaN API) for RAG or semantic search; rerank_documents then orders whatever a search over those vectors brings back. Returns only a summary — item count, dimensions and input tokens — because the vectors are far too large to put in the conversation, so use this to populate a store rather than to read values.
| Parameter | Type | Description |
|---|---|---|
input * | Single text or array of strings to embed. Passing the whole batch in one call is cheaper than one call per string | |
encoding_format | string | Encoding format. Default float |
rerank_documents Rerank Documents
Order documents by how well they answer a query, with Qwen3-Reranker-8B (NaN API). This is the second half of a RAG pipeline: embed_text builds the vectors a search runs over, and this one ranks what that search returns. Returns one line per document with its relevance score and its position in the input list, in the order the reranker gives them back.
| Parameter | Type | Description |
|---|---|---|
documents * | array | Candidate texts to re-rank, typically the top hits of a vector search |
query * | string | Query against which each document's relevance is measured |
top_n | integer | Limit response to the N most relevant documents |
edit_image Edit Image
Transform existing images with flux-2-klein image-to-image (NaN API). Use generate_image instead when starting from text alone. Takes 1 to 4 local reference files (PNG, JPEG or WebP, each under 25MB), saves the result under NAN_OUTPUT_DIR (default ~/nan-mcp-output) without overwriting anything, and returns the saved path and the temporary source URL. Counts against the shared account image quota (100/month, flux-2-klein and qwen-image-2.1).
| Parameter | Type | Description |
|---|---|---|
images * | array | Absolute paths to reference image files (PNG, JPEG, WebP; up to 4, each < 25MB) |
prompt * | string | Description of the edit or transformation to apply |
guidance | number | FLUX guidance scale |
n | integer | Number of images to generate (1-4). Default 1 |
outputName | string | Optional base name for the output file(s) |
seed | number | Base seed for reproducibility |
size | string | Image size "WxH" divisible by 16, e.g. 1024x1024, 1536x1024, 1024x1536. Default 1024x1024 |