Integráció

FTIR.fun MCP Server & REST API

Connect FTIR.fun to your AI assistant or automation pipeline. MCP server for Claude/Cursor/Codex. REST API for custom integrations. Same 130,000+ reference spectra and literature-backed AI interpretation across all methods.

MCP Server — Claude, Cursor, Codex

FTIR.fun's MCP (Model Context Protocol) server has been reviewed and officially listed on the Anthropic MCP Registry, Smithery, and MCP.so. It exposes FTIR spectral search, peak explanation with DOI-cited literature, and material identification as callable tools for any MCP-compatible client.

Quick Connect

# Claude Desktop / Claude Code claude mcp add ftirfun https://ftir.fun/mcp # Cursor # Add to ~/.cursor/mcp.json: {"mcpServers": {"ftirfun": {"url": "https://ftir.fun/mcp"}}} # OpenAI Codex codex mcp add ftirfun https://ftir.fun/mcp

Available Tools

ToolLeírás
search_ftir_librarySearch 130K+ reference spectra by peaks or uploaded file. Returns ranked matches with CAS numbers and similarity scores.
search_public_ftir_resultsSearch community-shared analysis results by keyword.
fetch_public_ftir_resultFetch a specific public FTIR analysis result by ID for detailed review.

Server Card & Registry Links

View All Platform Integrations

Coze Bővítmény — Használat a Doubao-n belül

Open Doubao → Plugin Store → search "FTIR" or "红外分析" → tap Add. No configuration needed. Doubao will automatically route infrared-related queries to our spectral search engine.

Keresőszavak: 红外分析, FTIR, infrared, 光谱检索, 物质识别

REST API

Könyvtár keresés API

POST /v1/search

Spektrumkönyvtár keresés. Elfogad egy fájlt (teljes spektrum egyeztetés) vagy egy csúcshullámszám listát (csúcspozíció egyeztetés). Ha mindkettő meg van adva, a fájlkeresés prioritást élvez.

Hitelesítés

X-API-Key: your-api-key

Kérés törzse

MezőTípusKötelezőLeírás
file_base64stringegyikeBase64-kódolt műszerfájl (támogatja a CSV, SPA, OPUS, SPC, JCAMP-DX és 15+ egyéb formátumot)
filenamestringfile_base64 paraméterrelEredeti fájlnév kiterjesztéssel (pl. sample.spa)
peaksnumber[]egyikeA csúcshullámszámok listája cm⁻¹-ben (pl. [3026, 1601, 1493, 755])
top_kintegernem (alapértelmezett 10)Visszaadandó találatok száma, maximum 50
toleranceintegernem (alapértelmezett 8)Csúcs egyeztetési tolerancia cm⁻¹-ben, tartomány 1–30

Válasz

{ "success": true, "search_mode": "full_spectrum", "n_matches": 10, "matches": [ { "rank": 1, "name": "Polystyrene", "cas": "25086-18-4", "num": 326, "similarity": 0.9586 } ], "file_format": "Thermo SPA", "n_points": 3601, "error": null }

Példa — fájlfeltöltés

import base64, requests with open("sample.spa", "rb") as f: b64 = base64.b64encode(f.read()).decode() resp = requests.post( "https://api.ftir.fun/v1/search", headers={"X-API-Key": "your-key", "Content-Type": "application/json"}, json={"file_base64": b64, "filename": "sample.spa", "top_k": 5}, ) print(resp.json())

Példa — csúcslista

import requests resp = requests.post( "https://api.ftir.fun/v1/search", headers={"X-API-Key": "your-key", "Content-Type": "application/json"}, json={"peaks": [3082, 3026, 2923, 1601, 1493, 1451, 1028, 906, 755, 699], "top_k": 5}, ) print(resp.json())

Csak AI elemzés meglévő eredményekhez

Használja ezt a végpontot csak akkor, ha egy keresési eredmény már létezik. Az FTIR.fun először elolvassa vagy OCR-ezi a megadott jelentést, kivonja a jelentett jelölteket és a minta csúcstáblázatot, majd elvégzi a downstream KG és irodalom által támogatott elemzést.

POST /ftir/analyze_existing_results

A jelentésnek tartalmaznia kell a jelentett keresési eredménylistát és a minta csúcstáblázatot is. Ez a végpont nem végez spektrális könyvtár keresést önmagában.

Hitelesítés

X-API-Key: your-api-key

Kérés törzse

MezőTípusKötelezőLeírás
report_textstringegyikeEgyszerű szöveg, amely egy meglévő műszer- vagy könyvtárjelentésből lett másolva. A szövegnek tartalmaznia kell a jelentett eredményeket és a minta csúcstáblázatot is.
report_file_base64stringegyikeBase64-kódolt jelentés fájl. Támogatott formátumok: PDF, DOC, DOCX, TXT, CSV, PNG, JPG, JPEG, WEBP, GIF, BMP, TIF, TIFF.
report_filenamestringreport_file_base64-velEredeti jelentés fájlnév kiterjesztéssel együtt (például report.pdf vagy report.docx).
user_background_textstringnemOpcionális minta háttér. Ez csak puha kontextusként kezelendő, nem bizonyítékként.

Kemény bemeneti határ

  • Szükséges elem 1: legalább egy jelentett keresési eredmény jelölt, például egy Top1 találat vagy Top15 lista
  • Szükséges elem 2: a minta csúcslista vagy csúcstáblázat cm-1-ben ugyanabból a jelentésből
  • Ha bármelyik elem hiányzik, a végpont HTTP 422-t ad vissza, és nem generál elemzési jelentést

Sikeres válasz

{ "success": true, "analysis_mode": "ai_only_existing_results", "message": "AI-only analysis completed from the supplied existing results report.", "input_requirements": { "service_boundary": "AI-only analysis starts after a search result already exists.", "required_inputs": [ "At least one reported search result candidate (Top1 or Top15).", "The sample peak table or peak list in cm-1." ] }, "missing_requirements": [], "missing_requirement_messages": [], "extracted_report": { "source_kind": "pdf", "used_ocr": true, "peak_values_cm1": [1736, 1601, 1241], "library_candidates": [ {"rank": 1, "name": "Polyethylene terephthalate", "cas_number": "25038-59-9", "raw_score_text": "856/1000", "normalized_similarity": 0.856} ] }, "summary": "Reported library results rank Polyethylene terephthalate first.", "report_view": {}, "final_decision": {}, "direct_evidence": {}, "related_literature": {} }

Hiányzó bemenet válasz

{ "detail": { "success": false, "analysis_mode": "ai_only_existing_results", "error": "missing_required_report_elements", "message": "AI-only analysis requires both reported library results and a sample peak table.", "missing_requirements": ["sample_peak_table"], "missing_requirement_messages": [ "Missing sample peak table. Provide the sample peak list or peak table in cm-1 from the same report." ], "input_requirements": { "failure_behavior": "If either the reported result list or the sample peak table is missing, the service stops and returns a 422 response." }, "extracted_report": { "report_has_library_results": true, "report_has_peak_table": false } } }

Példa – Meglévő jelentés szöveg

import requests report_text = """ Sample: PET fragment Top1: Polyethylene terephthalate Score: 856/1000 Top2: Polyester resin Score: 801/1000 Peak table (cm-1): 3435, 2932, 1715, 1409, 1241, 1093, 1017, 872, 722 """ resp = requests.post( "https://api.ftir.fun/ftir/analyze_existing_results", headers={"X-API-Key": "your-key", "Content-Type": "application/json"}, json={"report_text": report_text, "user_background_text": "consumer packaging fragment"}, ) print(resp.json())

Példa – Meglévő jelentés fájl

import base64, requests with open("instrument-report.pdf", "rb") as f: b64 = base64.b64encode(f.read()).decode() resp = requests.post( "https://api.ftir.fun/ftir/analyze_existing_results", headers={"X-API-Key": "your-key", "Content-Type": "application/json"}, json={ "report_file_base64": b64, "report_filename": "instrument-report.pdf", "user_background_text": "suspected packaging adhesive", }, ) print(resp.json())

Hibakódok

HTTP állapotJelentés
200Siker
401Hiányzó vagy érvénytelen API kulcs
422Érvénytelen kérelem törzs, nem támogatott jelentésformátum, vagy hiányzó szükséges jelentéselemek
500Szerveroldali hiba
Kérelem benyújtása Űrlap