การผสานรวม

เซิร์ฟเวอร์ MCP และ REST API ของ FTIR.fun

เชื่อมต่อ FTIR.fun กับผู้ช่วย AI หรือไปป์ไลน์อัตโนมัติของคุณ เซิร์ฟเวอร์ MCP สำหรับ Claude/Cursor/Codex REST API สำหรับการรวมที่กำหนดเอง สเปกตรัมอ้างอิงกว่า 130,000 รายการและการตีความ AI ที่สนับสนุนด้วยวรรณกรรมเดียวกันทุกวิธี

MCP Server — Claude, Cursor, Codex

เซิร์ฟเวอร์ MCP (Model Context Protocol) ของ FTIR.fun ได้รับการตรวจสอบและถูกระบุอย่างเป็นทางการใน Anthropic MCP Registry, Smithery และ MCP.so โดยเปิดเผยการค้นหาสเปกตรัม FTIR, การอธิบายยอดสูงสุดพร้อมวรรณกรรมที่อ้างอิง DOI และการระบุวัสดุเป็นเครื่องมือที่เรียกใช้ได้สำหรับไคลเอนต์ที่เข้ากันได้กับ MCP ทุกตัว

เชื่อมต่อด่วน

# 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

เครื่องมือที่มีอยู่

เครื่องมือคำอธิบาย
search_ftir_libraryค้นหาสเปกตรัมอ้างอิงกว่า 130K รายการโดยยอดสูงสุดหรือไฟล์ที่อัปโหลด ส่งคืนคู่ที่จัดอันดับพร้อมหมายเลข CAS และคะแนนความคล้ายคลึง
search_public_ftir_resultsค้นหาผลการวิเคราะห์ที่แชร์โดยชุมชนด้วยคำสำคัญ
fetch_public_ftir_resultดึงผลการวิเคราะห์ FTIR สาธารณะเฉพาะโดย ID เพื่อตรวจสอบโดยละเอียด

การ์ดเซิร์ฟเวอร์และลิงก์รีจิสทรี

  • Server Card (JSON) — ปลายทางการค้นพบเซิร์ฟเวอร์ MCP มาตรฐาน
  • Anthropic MCP Registry — ถูกระบุอย่างเป็นทางการ
  • Smithery — ตรวจสอบและเผยแพร่แล้ว
  • MCP.so — ถูกระบุ
  • PyPI (ftirfun-mcp) — แพ็กเกจ Python

ดูการรวมแพลตฟอร์มทั้งหมด

Coze Plugin — ใช้ภายใน Doubao

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

คำค้นหา: 红外分析, FTIR, infrared, 光谱检索, 物质识别

REST API

API ค้นหาห้องสมุด

POST /v1/search

การค้นหาคลังสเปกตรัม ยอมรับไฟล์ (การจับคู่เต็มสเปกตรัม) หรือรายการพีค (การจับคู่ตำแหน่งพีค) หากระบุทั้งสองอย่าง การค้นหาไฟล์จะได้รับการจัดลำดับความสำคัญก่อน

การรับรองตัวตน

X-API-Key: your-api-key

เนื้อหาคำขอ

ฟิลด์ประเภทจำเป็นคำอธิบาย
file_base64stringหนึ่งในไฟล์เครื่องมือที่เข้ารหัส Base64 (รองรับ CSV, SPA, OPUS, SPC, JCAMP-DX และรูปแบบอื่นๆ อีกมากกว่า 15 รูปแบบ)
filenamestringพร้อม file_base64ชื่อไฟล์ต้นฉบับรวมนามสกุล (เช่น sample.spa)
peaksnumber[]หนึ่งในรายการเลขคลื่นพีคในหน่วย cm⁻¹ (เช่น [3026, 1601, 1493, 755])
top_kintegerไม่ (ค่าเริ่มต้น 10)จำนวนผลลัพธ์ที่จะส่งคืน สูงสุด 50
toleranceintegerไม่ (ค่าเริ่มต้น 8)ค่าความคลาดเคลื่อนของการจับคู่พีคในหน่วย cm⁻¹, ช่วง 1–30

คำตอบ

{ "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 }

ตัวอย่าง — การอัปโหลดไฟล์

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())

ตัวอย่าง — รายการพีค

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())

การวิเคราะห์เฉพาะ AI สำหรับผลลัพธ์ที่มีอยู่

ใช้ปลายทางนี้หลังจากมีผลการค้นหาอยู่แล้วเท่านั้น FTIR.fun อ่านหรือ OCR รายงานที่ให้มา, แยกผู้สมัครที่รายงานและตารางพีคตัวอย่าง, จากนั้นดำเนินการวิเคราะห์ KG และวรรณกรรมที่สนับสนุน

POST /ftir/analyze_existing_results

รายงานต้องมีทั้งรายการผลการค้นหาที่รายงานและตารางพีคตัวอย่าง ปลายทางนี้ไม่ดำเนินการค้นหาห้องสมุดสเปกตรัมด้วยตัวเอง

การรับรองตัวตน

X-API-Key: your-api-key

เนื้อหาคำขอ

ฟิลด์ประเภทจำเป็นคำอธิบาย
report_textstringหนึ่งในข้อความธรรมดาที่คัดลอกจากรายงานเครื่องมือหรือห้องสมุดที่มีอยู่ ข้อความต้องรวมทั้งผลลัพธ์ที่รายงานและตารางพีคตัวอย่าง
report_file_base64stringหนึ่งในไฟล์รายงานที่เข้ารหัส base64 รูปแบบที่รองรับ: PDF, DOC, DOCX, TXT, CSV, PNG, JPG, JPEG, WEBP, GIF, BMP, TIF, TIFF
report_filenamestringพร้อม report_file_base64ชื่อไฟล์รายงานต้นฉบับรวมถึงนามสกุล (เช่น report.pdf หรือ report.docx)
user_background_textstringไม่พื้นหลังตัวอย่างที่เป็นทางเลือก สิ่งนี้ถือเป็นเพียงบริบทที่นุ่มนวลและไม่ใช่หลักฐาน

ขอบเขตข้อมูลนำเข้าที่เข้มงวด

  • องค์ประกอบที่จำเป็น 1: อย่างน้อยหนึ่งผู้สมัครผลการค้นหาที่รายงาน เช่น รายการ Top1 หรือรายการ Top15
  • องค์ประกอบที่จำเป็น 2: รายการพีคหรือตารางพีคของตัวอย่างในหน่วย cm-1 จากรายงานเดียวกัน
  • หากองค์ประกอบใดขาดหาย, ปลายทางจะส่งคืน HTTP 422 และไม่สร้างรายงานการวิเคราะห์

การตอบสนองสำเร็จ

{ "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": {} }

การตอบสนองเมื่อข้อมูลขาดหาย

{ "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 } } }

ตัวอย่าง — ข้อความรายงานที่มีอยู่

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())

ตัวอย่าง — ไฟล์รายงานที่มีอยู่

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())

รหัสข้อผิดพลาด

สถานะ HTTPความหมาย
200สำเร็จ
401คีย์ API หายไปหรือไม่ถูกต้อง
422เนื้อหาคำขอไม่ถูกต้อง, รูปแบบรายงานที่ไม่รองรับ, หรือองค์ประกอบรายงานที่จำเป็นขาดหาย
500ข้อผิดพลาดฝั่งเซิร์ฟเวอร์
ส่งคำขอ แบบฟอร์ม