Give your AI assistant or your own code direct access to 320,000+ reference spectra, knowledge-graph peak reasoning, and literature-backed interpretation. Choose one of three ways to connect — MCP for AI assistants, the REST API for code, or a ready-made Skill for no-code platforms. Every path below has step-by-step instructions written for first-time users.
MCP and the REST API both use one FTIR.fun API key. Coze/Doubao uses a service key configured by the plugin publisher, so end users work through the plugin without pasting a personal key. Getting a personal key takes about a minute:
Sign in to FTIR.funCreate a free account (new accounts include free trial credits).
View or copy your API keyThe full key (it starts with ftir_) remains available in the API Keys dashboard. You can return there to view, copy, or revoke it.
All three connect to the same engine: 320,000+ spectra, knowledge-graph reasoning, and literature citations. You only need one. Pick the path that matches how you work; MCP is a convenient option for AI assistant users.
MCPPath A — MCP Server
MCP (Model Context Protocol) is the standard way for AI assistants to call outside tools. FTIR.fun runs a hosted MCP server — no local installation required. You add one small config to your AI client, enter your API key, and your assistant gains the FTIR.fun tools enabled for that key.
✓How sign-in works (read this first):
FTIR.fun authenticates with the API key from your account, sent as an Authorization: Bearer header. There is no OAuth browser sign-in and no separate authorization page. If a client ever tries to open an authorization webpage, it is using an outdated config — see Troubleshooting below.
Pick your client for exact steps:
VS
Set up FTIR.fun MCP in VS Code
Requires a current VS Code with GitHub Copilot Chat in Agent mode.
Open your project, then create the file .vscode/mcp.jsonInside your project folder, make a folder named .vscode (if it does not exist) and a file named mcp.json inside it. Want FTIR.fun available in every project? Put the same JSON in your user-level settings: open the Command Palette, search 'Preferences: Open User Settings (JSON)', and add an mcp.servers entry there instead.
Paste this exact configurationCopy it as-is. Keep the ${input:...} placeholder — VS Code will ask for the key securely when the server starts.
Start the ftirfun serverOpen the Command Palette, run “MCP: List Servers”, select ftirfun, and choose Start. Some VS Code versions show a Start action right above the server in mcp.json — that works too.
Paste only your API key when promptedWhen VS Code asks for ftirfun-api-key, paste just the raw key (starts with ftir_). The config adds Bearer automatically.
Confirm it connectedOpen Copilot Chat in Agent mode and check the tools list. FTIR.fun should show the unified tool catalog; calls outside this key's capability scope return a permission error. Then try the test prompt below.
Use FTIR.fun to explain the FTIR peak at 1715 cm-1.
💬Saw an authorization page or an “authorization page does not exist” error before? That was an outdated OAuth-style config. Delete the old ftirfun entry, paste the JSON above, reload VS Code, and start it again. Full fix in Troubleshooting.
A
Set up FTIR.fun MCP in Claude
Officially listed on the Anthropic MCP Registry. Works in Claude Desktop and Claude Code.
Open MCP server settingsIn Claude Desktop, go to Settings → Connectors → Add custom connector. In Claude Code, edit your MCP config file.
Add the remote server and Bearer headerUse the hosted URL and add your API key as an Authorization header. Replace the placeholder with your real key (starts with ftir_).
Restart Claude and confirmRestart Claude Desktop, open the connectors/tools panel, and confirm FTIR.fun tools appear. Then ask a question in plain language.
Identify this polymer from its FTIR peaks: 2915, 1715, 1450 cm-1.
📎Prefer Claude Code CLI? Run claude mcp add --transport http ftirfun https://ftir.fun/mcp --header "Authorization: Bearer ftir_your_key_here".
Cu
Set up FTIR.fun MCP in Cursor
Edit Cursor’s MCP config so your AI code editor can call FTIR.fun without leaving the IDE.
Open the MCP config fileCreate or edit ~/.cursor/mcp.json (global) or .cursor/mcp.json inside your project.
Paste the server blockReplace the placeholder with your real key (starts with ftir_).
Reload Cursor and confirmReopen Cursor, check Settings → MCP for the ftirfun server and its green status, then ask in chat.
Cx
Set up FTIR.fun MCP in Codex or any MCP harness
Works with OpenAI Codex and any MCP-compatible client that supports remote HTTP servers.
Add the server to your Codex configPoint the client at the hosted URL and ensure it sends your API key as a Bearer header. Replace the placeholder with your real key.
Restart and confirm the tools loadRestart the client and confirm the FTIR.fun tool catalog is listed before prompting. The API key controls which capabilities can be called.
Gm
Set up FTIR.fun MCP in Gemini CLI
Add FTIR.fun to an MCP-capable Gemini client using the same hosted URL and Bearer header.
Edit ~/.gemini/settings.jsonAdd an httpUrl server entry with your API key header. Replace the placeholder with your real key.
Restart Gemini CLI and confirmRun /mcp to list servers and confirm ftirfun is connected before prompting.
🧩Using another MCP client? Any client that supports a remote streamable-HTTP server works: set the URL to https://ftir.fun/mcp and send Authorization: Bearer <your key>. See the public server card for the full tool schema: server-card.json
✓After a successful connection, your AI client should list these 7 tools:parse_ftir_spectrum, analyze_ftir_spectrum, submit_ftir_report, get_ftir_report_status, explain_peaks, find_spectra, fetch_result.
If you see fewer tools or none at all, check Troubleshooting below.
APIPath B — REST API
Call the unified FTIR.fun REST service from your own code in any language — Python, JavaScript, R, MATLAB, Java, Go. Your API key controls the available capabilities, from identifying unknown spectra and explaining peaks to reference lookup, reports, LIMS workflows, and other account-enabled operations.
Check that the REST service is onlineThe health endpoint is public and does not consume points. It should return the JSON below. If you see an HTML page or a timeout, the service may be temporarily down.
curl
curl https://ftir.fun/health
Expected response
{"status":"ok","service":"ftirfun-api"}
Authenticate with the X-API-Key headerEvery protected endpoint takes your key in an X-API-Key header. The same account rules apply as in the web app: points, subscription, and rate limits. If the key is wrong or missing, you will get a 401 JSON error; if its capability scope does not include the operation, you will get a 403 capability_not_enabled response.
Auth header
X-API-Key: ftir_your_key_here
Make your first call — identify an unknown spectrumSend a peak list (or an uploaded file) and get ranked candidate materials with similarity scores and peak evidence. The options block is optional — defaults are top_k=15 (range 1–50) and tolerance_cm1=8 (range 1–30).
{
"success": true,
"search_mode": "peak_only",
"n_matches": 5,
"confidence": 0.42,
"confidence_source": "peak_match_score",
"summary": "Peak-based FTIR matching ranks Styrene/acrylonitrile copolymer first...",
"matches": [
{"rank": 1, "name": "Styrene/acrylonitrile copolymer", "cas": "9003-54-7",
"num": 119319, "score": 0.4214, "matched": 6}
],
"evidence": ["3026 cm-1 -> alkyl C-H vibration (DOI 10.5650/jos.ess14201)"],
"peak_explanations": [
{"peak_cm1": 3026, "assignment": "alkyl C-H vibration",
"evidence_type": "kg_peak_group"}
],
"uncertainty": "The leading match is close to the runner-up..."
}
Explore the rest of the endpointsThe full reference covers every endpoint, request and response formats, error codes, and more code samples. See the API Documentation.
What you want
Endpoint
Input
Identify an unknown spectrum
POST /ftir/analyze_spectrum
JSON body with spectrum.peaks or file_base64
Explain one or more peaks
POST /ftir/explain_peak_assignments
JSON body with peaks list or query text
Find a known reference spectrum
POST /ftir/find_spectra
JSON body with query string
Fetch a past result by report number
GET /ftir/result/{result_num}
Path parameter, optional ?language_code=en
Submit a full async report, then poll it
POST /ftir/reports · GET /ftir/reports/{task_id}
JSON body with file_base64 (required)
Recover a lost task_id, or list your recent analyses
GET /ftir/tasks
No body; returns your most recent tasks with task_id, status, and result_num
Parse an instrument file to peaks
POST /parse-spectrum
Multipart file upload OR JSON with file_base64
Convert a native file with metadata preservation
POST /native-spectrum/convert
Multipart file plus output_format OR JSON with file_base64, filename and output_format
💡Tip: POST /ftir/analyze_spectrum is the single recommended entry point for spectrum identification. The older /v1/search, /ftir/identify_material and /ftir/match_library_topk endpoints remain available as compatibility aliases — new integrations only need analyze_spectrum.
Key parameter reference
Parameter
Type
Default
Range
Used by
top_k
int
15
1–50
analyze_spectrum
tolerance_cm1
int
8
1–30
analyze_spectrum
limit
int
10
1–20
find_spectra
sampling_mode
string
(empty)
See list below
reports, explain_peaks
language_code
string
"en"
ISO 639-1
reports, fetch_result
include_report
bool
true
—
get_ftir_report_status
📘Building a custom GPT or importing into another tool? Import our OpenAPI schema directly: openapi.platform.yaml.
Parse an instrument file (two ways)
The /parse-spectrum endpoint accepts either a multipart file upload or a JSON body with base64-encoded content. Both return the same response: detected peaks and the full curve.
Convert a native instrument file (CSV, JDX, or JSON)
Use the native converter when you need a canonical curve, source metadata, provenance and explicit preservation warnings. It keeps the original parser's metadata in metadata.raw and returns the converted artifact as content_base64.
↗Prefer the browser workflow? Open Native FTIR Spectrum Converter. Archives and report/document formats are rejected; the converter is separate from Image → CSV.
SkillPath C — Skills & Plugins
For popular AI and automation platforms we ship ready-made packages with pre-built API integration. Install a package or import a plugin, and FTIR.fun becomes a building block in your workflow. Each card below tells you exactly what to run or import.
LC
LangChain
Python package · PyPI
Published
Drop-in tools for building FTIR-aware agents. Handles Base64 encoding, retries, and async calls for you.
Install
pip install langchain-ftirfun
Minimal call
from langchain_ftirfun import explain_peaks
result = explain_peaks(
api_base_url="https://ftir.fun",
api_key="ftir_your_key_here",
peaks=[1715],
)
print(result)
Import FTIRFUN_TOOLS to get the published function list. Each function takes api_base_url and api_key as the first two arguments; the server enforces the capabilities enabled for that key.
The Coze cloud plugin is published with three tools: spectrum analysis, reference library search, and peak explanation. End users can use it directly in Doubao without configuring any API key.
Add FTIR.fun as a custom tool in your Dify apps and agents by importing the same OpenAPI schema.
Import URL
https://ftir.fun/openapi.platform.yaml
In Dify: Tools → Create Custom Tool → import the schema, set the X-API-Key header.
Gm
Google Gemini API
Function declarations (SDK integration)
Ready
Use ready-made function declarations to call FTIR.fun from the Gemini API’s function-calling flow in your own code.
Declarations cover the published operations, including parsing and asynchronous full reports. The server enforces the capabilities enabled for each API key.
The unified MCP and REST services expose the same FTIR.fun operation catalog. API keys may receive a smaller capability scope, while platform-specific declarations can intentionally publish only a subset. The operations below share the same FTIR.fun services.
Task
MCP tool
REST endpoint
Say this to your AI
Read an instrument file
parse_ftir_spectrum
POST /parse-spectrum
Parse sample.spc and list the detected peaks.
Convert native data and preserve metadata
convert_native_spectrum
POST /native-spectrum/convert
Convert sample.spa to JDX and keep the source metadata.
Identify an unknown spectrum
analyze_ftir_spectrum
POST /ftir/analyze_spectrum
Identify what polymer this spectrum is.
Submit a full tri-axis report
submit_ftir_report
POST /ftir/reports
Submit sample.spa for a full report in ATR mode.
Poll and retrieve that report
get_ftir_report_status
GET /ftir/reports/{task_id}
Check the report task and give me the link when done.
Explain peaks
explain_peaks
POST /ftir/explain_peak_assignments
What do the peaks at 1715 and 1450 cm-1 indicate?
Find a known reference spectrum
find_spectra
POST /ftir/find_spectra
Find reference spectra for polystyrene.
Reopen an earlier result
fetch_result
GET /ftir/result/{result_num}
Fetch result 20260528100755416137536.
🎓Academic Peak Assignment —
For samples with a known composition, the advanced FTIR.fun REST/MCP capability assigns every measured peak with literature-tracked evidence. Each submission costs 30 points, or is free with an active subscription; status queries are not charged.
Describe the task naturally (for example: “Assign all measured FTIR peaks for this spectrum; the sample is known PMMA; email the report to me”) — the client supplies the file and you never need to construct JSON or Base64 yourself. Completed results return both the JSON status and protected report addresses; reports are not exposed on a public download path.
Supported spectrum filename extensions (36): .spa, .spc, .sp, .abs, .irf, .irs, .dt, .jws, .jdx, .dx, .asc, .dpt, .opju, .opus, .ispd, .[0-9]+, .xlsx, .xls, .ods, .csv, .dat, .txt, .tsv, .json, .tab, .a2r, .asp, .spe, .map, .bsp, .spg, .srs, .smf, .ird, .fsm, .mat. Keep the original filename extension. Unsupported or unreadable files return supported_extensions and supported_formats. Valid sampling_mode values are KBr Pellet, Vapor, Solvent, Thin Film, Paraffin Mull, ATR, Diffuse Reflectance, Micro IR, and Others. Transmission is not a valid value.
{
"success": true,
"search_mode": "peak_explanation",
"peak_explanations": [
{"peaks_cm1": [1715, 1450],
"assignment": "1715 cm-1 suggests C=O stretching (ester or carboxylic acid)...",
"evidence_type": "llm_general_knowledge"}
],
"summary": "Peak explanation based on general FTIR knowledge..."
}
Getting the full report (async)
Quick screening (analyze_spectrum) returns immediately. The full tri-axis report runs in the background and typically takes 30–90 seconds. Keep the task_id and poll it rather than resubmitting.
SubmitCall submit_ftir_report (MCP) or POST /ftir/reports (REST). You get back a task_id and a reserved result_num. The file_base64 field is required; other fields (sampling_mode, prior_context, language_code, sample_name, sample_order_no) are optional.
PollCall get_ftir_report_status (MCP) or GET /ftir/reports/{task_id} every 5–10 seconds until completed is true. The completed response includes report_url, a report object (structured result content, with the detailed report_view inside it), and result_num.
Open the final reportOpen the full URL https://ftir.fun/outputdata/?num={result_num} in a browser to view the complete tri-axis result page rendered by FTIR.fun.
⚠️Keep the task_id and poll until complete or failed. Duplicate submissions while queued or running waste points.
Troubleshooting
What you see
What it means
What to do
The client opens a browser authorization page, or says the authorization page does not exist.
Your client is using an old OAuth-style server entry. FTIR.fun does not use OAuth — only an API key.
Delete the old ftirfun server entry, paste the exact config from this page, reload the client, and start ftirfun again.
401 (MCP) / 401 invalid_api_key (REST)
The API key is missing, expired, revoked, or pasted incorrectly.
Restart the server and paste only the raw key (starts with ftir_). Generate a fresh key from the API Keys Dashboard if needed.
The server starts but no tools appear.
The client has not refreshed its catalog, or the config uses the wrong key name.
For VS Code, confirm mcp.json uses servers (not mcpServers). Then stop and start ftirfun, or reload the window.
403 insufficient_balance
The account does not have enough points for that analysis.
Check your balance or subscription in FTIR.fun, then retry.
429 rate_limit_exceeded
REST analysis and parsing allow 60 requests per minute per API key; REST result and report-status reads use a separate 120 requests per minute bucket; MCP allows 60 calls per minute for each API key and tool.
Wait for the retry period reported by the tool before calling again.
A report stays queued or running.
Full reports run asynchronously and take longer than quick screening.
Keep the same task_id and poll. If you lost the task_id, call GET /ftir/tasks to list your recent tasks and find it again.
422 or missing_input
The request body is missing required fields or has invalid format. For analyze_spectrum, you must provide at least one of: peaks, query, or file_base64.
Check that your JSON is valid, Content-Type is application/json, and required fields are present. See the example requests above.
413 file_too_large
The uploaded spectrum file exceeds the size limit.
Export a smaller file or use only peak positions via the spectrum.peaks field.
Ready to build?
The full REST reference has every endpoint, request and response formats, authentication, rate limits, error codes, MCP tool definitions, and code examples in Python and curl.