Headai MCP Server

Connect AI agents to decision intelligence — knowledge graphs, competitive analysis, trend signals, and recommendations from 150M+ data points.

24 Tools Read-only Safe Streamable HTTP OAuth 2.0 v1.2.0

Overview

Headai MCP Server is a Model Context Protocol server that connects AI agents — Claude, ChatGPT, GitHub Copilot, Cursor, or any MCP client — to Headai's Core Engine APIs. Build knowledge graphs from job ads, research articles, curricula, investment data, and more. Compare skills, detect trends, and get AI-powered career recommendations.

Server endpoints

POST/mcp — MCP protocol (JSON-RPC 2.0, Streamable HTTP)
GET/mcp — SSE stream for active sessions
DELETE/mcp — Session termination
GET/sse — Legacy SSE transport
POST/messages — Legacy SSE message endpoint
GET/health — Health check (JSON)
GET/tools — Tool listing (JSON)

Authentication

API key authentication

Every request requires a Headai API key. The server supports two auth modes:

Remote (OAuth 2.0): Connect via the hosted server at mcp.headai.dev. The OAuth flow prompts you to enter your API key during authorization.

Local (stdio): Set the HEADAI_API_KEY environment variable when running locally.

Contact headai.com for API key provisioning.

Setup

Claude Desktop / Claude Code (stdio)

{
  "mcpServers": {
    "headai": {
      "command": "node",
      "args": ["/path/to/headai-mcp-server/dist/index.js"],
      "env": {
        "HEADAI_API_KEY": "your_api_key_here"
      }
    }
  }
}

Remote server (Claude.ai, ChatGPT, Copilot)

MCP Server URL: https://mcp.headai.dev/mcp
Transport: Streamable HTTP
Auth: OAuth 2.0 (enter your API key during authorization)

Cursor / Windsurf

{
  "mcpServers": {
    "headai": {
      "url": "https://mcp.headai.dev/mcp",
      "transport": "streamable-http"
    }
  }
}

Tool reference

All 25 tools organized by category. Parameters marked required must be provided; others are optional with sensible defaults.

Core NLP Graph building Analysis & comparison Recommendations Graph operations Career intelligence Utility & admin Orchestration

Core NLP

headai_text_to_graphasync

Convert free-form text (CV, job description, article, course description) into a structured semantic knowledge graph using the v2 engine. Extracts skills, concepts, and relationships with optional plural grouping and semantic cleaning.

Endpoint: POST /v2/TextToGraph

ParameterTypeDescription
text requiredstringText to convert (min 10 chars)
languagestringISO language code default: "en"
ontologystringOntology: headai, esco, yso, fibo default: "headai"
legendstringLabel for the resulting graph
keyword_typestring"only_compounds" for compound words only
group_pluralsbooleanCollapse plural/singular variations into base form default: false
enable_semantic_cleaningbooleanGroup semantically similar words together default: false
translate_tostringTranslate output to another language (fi, sv, de, fr, es...)
noise_liststringComma-separated keywords to exclude
use_stored_noisebooleanUse noise list stored for API key
headai_text_to_keywordsread-only

Extract weighted keywords and key concepts from text. Returns keywords with importance weights and quality indicators.

Endpoint: POST /TextToKeywords

ParameterTypeDescription
text requiredstringText to extract keywords from (min 10 chars)
languagestringISO language code default: "en"
ontologystringOntology to use default: "headai"
keyword_typestring"only_compounds" for compound words only
noise_liststringComma-separated keywords to exclude
use_stored_noisebooleanUse stored noise list

Graph building

headai_build_knowledge_graph_v2asyncread-only

Preferred for all new builds. Faster engine with built-in quality processing: focused_build, plural grouping, semantic cleaning, and topic drift analysis. Two-step confirmation gate: first call returns preview + hash, second call with hash starts the build.

Endpoint: POST /v2/BuildKnowledgeGraph

ParameterTypeDescription
dataset requiredstringDataset: job_ads, investments, doaj, theseus, tiedejatutkimus, curriculum, news
Note: v2 uses "investments" (not "investment_data") and "doaj" (not "doaj_articles")
search_text requiredstringComma-separated search terms. Commas = OR, hyphens = AND. Supports field scoping: school:SAMK, programme:ICT
languagestringLanguage code default: "en"
ontologystringOntology default: "headai"
legendstringGraph label
search_yearstring|numberYear filter. Required for doaj, investments, news, tiedejatutkimus
search_monthstring|numberMonth filter (0 = all)
startDate / endDatestringDate range YYYY-MM-DD
countrystringCountry code (e.g. "fi"). Mutually exclusive with city
citystringCity name or comma-separated list
sizenumberSample size 1-5000 default: 300
focused_buildbooleanPrune for strong triplets only default: true
group_pluralsbooleanCollapse singular/plural variants default: true
enable_semantic_cleaningbooleanCosine dedup on node embeddings default: true
analyzebooleanRun Topic Drift Analysis default: false
word_typestring"only_compounds" for multi-word terms
noise_liststringComma-separated exclusions
updatebooleanForce rebuild even if cached
preview_hashstringLeave empty on first call. Provide hash from preview to start build
headai_scorecard_v2asyncread-only

Compare two knowledge graphs using the v2 engine with automatic semantic matching (cosine similarity). Collapses conceptually similar nodes, returns richer scoring (full_score, important_topics_score, data quality indicators), and persists results to a URL. Preferred for graph-vs-graph comparisons.

Endpoint: POST /v2/Scorecard

ParameterTypeDescription
graph_1 requiredstring|objectFirst knowledge graph (Goal) — URL string or JSON object
graph_2 requiredstring|objectSecond knowledge graph (Document) — URL string or JSON object
legend_1stringDisplay name for first graph default: "Goal"
legend_2stringDisplay name for second graph default: "Document"
limitintegerMin node weight for inclusion default: 1
noise_liststringComma-separated keywords to filter out
enable_semantic_cleaningbooleanCollapse similar nodes via cosine similarity default: true
updatebooleanForce rebuild if cached default: false
force_restartbooleanForce restart calculation default: false
headai_build_signalsasyncread-only

Analyze trends across 2+ chronological knowledge graph snapshots. Classifies skills into 8 signal groups: Emerging, Constantly Increasing, Increasing Last Period, Constant, Constant Last Period, Constantly Decreasing, Decreasing Last Period, Disappearing.

Endpoint: POST /BuildSignals

ParameterTypeDescription
urls requiredstringComma-separated graph URLs in ascending time order (min 2)
map_legends requiredstringComma-separated labels, one per URL. Must be years if predict=true
predictbooleanGenerate prediction for next period default: false
datasetstring"doaj", "job_ads", or "custom" default: "custom"
titlestringBase title for the signal series
headai_run_analystadvanced

Advanced — prefer clean_graph and quality_check for common operations. Run a named analysis algorithm on knowledge graphs, scorecards, or signal results — hubs, cross-field bridges, gap analysis, quick wins, emerging and fading trends, undervalued niches, and quality scoring.

ParameterTypeDescription
url requiredstringURL of the Headai graph to analyze
report requiredintegerAlgorithm code to run (e.g. 309 gap analysis, 1 hubs, 401 emerging trends).
modeintegerMode bitmask. Flags: 8=Finnish, 16=TOP10, 32=TOP20, 256=PLAIN, 512=JSON, 1024=TOP100 default: 1280
headai_visual_reportread-only

Extract structured data from a graph for visualization: companies (with counts), cities (with coordinates), skills (weights, degrees, groups), source documents, and statistics. No API call — fetches graph JSON directly.

Endpoint: Direct HTTP GET (no Megatron call)

ParameterTypeDescription
graph_url requiredstringGraph JSON URL from a previous build
titlestringReport title (defaults to graph legend)

Recommendations

headai_compassread-only

Get personalized course or job recommendations based on a skill profile. Returns ranked recommendations with match scores, new skills gained, and details. Supports Zone of Proximal Development (ZPD) matching.

Endpoint: POST /Compass (timeout: 320s)

ParameterTypeDescription
skills requiredstring[]User's current skills as concept strings (min 1)
namespace requiredstringTarget namespace (e.g. "metropolia", "TMT", "any", "kuntarekry")
requeststring[]Modes: "match", "zpd", "demand", "jobs", "companies", "curriculum", "researcher" default: ["match"]
interestsstring[]User's goal/interest skills
languagestringLanguage default: "en"
completedstring[]Completed courses (course recs only)
mandatorystring[]Mandatory courses
country_limitstring[]ISO country codes for job search
city_limitstring[]City names for job search
headai_get_jobs_by_textread-only

Search for real, current job listings matching skills or keywords. Returns job ads with title, company, URL, match score, matched skills, and missing skills.

Endpoint: POST /Utils (action: get_jobs_by_text)

ParameterTypeDescription
searchstringFree text search query
keywordsstringComma-separated skill keywords
area requiredstringCity or region
country requiredstringISO 2-letter country code
language requiredstringISO 2-letter language code
authorstringSource: "mol" or "tmt"
limitnumberMax results 10-50 default: 20
removestringKeywords to exclude

Graph operations

headai_join_graphsread-only

Merge two or more knowledge graphs into a single combined graph.

Endpoint: POST /JoinKnowledgeGraphs

ParameterTypeDescription
urlsstringComma-separated graph URLs (e.g. "url1,url2")
graph_1 / graph_2objectGraph JSON objects (alternative to urls)
titlestringTitle for merged graph
headai_clean_graphcomposite

Remove noise and low-quality nodes from a knowledge graph. Native algorithm — no manual chaining needed.

Endpoint: Native algorithm + POST /ModifyKnowledgeGraph

ParameterTypeDescription
graph_url requiredstringURL of the knowledge graph to clean
aggressivenessstring"light" | "normal" (default) | "aggressive" — how much noise to remove
headai_quality_checkread-only

Structural quality score 0-100 with actionable recommendations for any knowledge graph.

Endpoint: Native algorithm (graph analysis)

ParameterTypeDescription
graph_url requiredstringURL of the knowledge graph to assess
headai_modify_graphread-only

Filter and refine a knowledge graph by removing nodes, adjusting weights, or filtering by keywords.

Endpoint: POST /ModifyKnowledgeGraph

ParameterTypeDescription
url requiredstringURL to the graph to modify
keywordsstringComma-separated keywords to keep
weightnumberMinimum weight threshold (1-5)
valuenumberMinimum value threshold
max_nodesnumberMaximum nodes to keep
removestringComma-separated keywords to remove
word_typestring"only_compounds" for multi-word terms
title / legendstringNew title or legend labels
headai_translate_graphread-only

Translate a knowledge graph between languages while preserving structure and relationships.

Endpoint: POST /TranslateKnowledgeGraph

ParameterTypeDescription
urlstringURL to the graph (provide url or data, not both)
dataobjectGraph JSON object (alternative to url)
language requiredstringSource language code
translate_to requiredstringTarget: BG, CS, DA, DE, EL, EN, ES, ET, FI, FR, HU, ID, IT, JA, LT, LV, NL, PL, PT, RO, RU, SK, SL, SV, TR, UK, ZH

Career intelligence

headai_digital_twinwrites data

Persistent, evolving skills profile stored on Headai. Operations: "add" (save graph as profile), "get" (retrieve stored profile), "share" (generate secure shareable URL).

Endpoint: POST /DigitalTwinStorage/AddToTwin (add) · GET /DigitalTwinStorage/GetTwin (get) · GET /DigitalTwinStorage/GetSecureShareLink (share)

ParameterTypeDescription
operation requiredenum"add", "get", or "share"
twin_key requiredstringUnique twin identifier (e.g. "user_123")
graph_urlstringGraph URL to store (required for "add")
headai_skills_profilercompositewrites data

Builds an individual's Digital Twin from unstructured text (CV, portfolio, hobbies) and optional KOSKI data. Two-phase: preview extracted skills, then store after user review. Supports skill approval/rejection.

Chains: TextToGraph → JoinGraphs (optional) → ModifyGraph (optional) → DigitalTwin add

ParameterTypeDescription
cv_text requiredstringCV / free text / portfolio (min 20 chars)
user_key requiredstringUnique Digital Twin identifier
koski_textstringOptional KOSKI transcript text
languagestringLanguage default: "en"
legendstringGraph label
preview_hashstringHash from preview to confirm storage
rejected_skillsstringComma-separated skills to remove
approved_skillsstringComma-separated skills to keep (removes all others)
headai_career_navigatorcompositeread-only

Compares an individual's Digital Twin against a target (job market, free-text role, or employer profile). Produces gap analysis with training recommendations or job matches.

Chains: DigitalTwin get → BKG/TextToGraph (target) → Scorecard → Compass/Jobs

ParameterTypeDescription
user_key requiredstringDigital Twin key for the user
target_type requiredenum"job_market", "text", or "twin"
target_value requiredstringSearch text (job_market), free text (text), or twin_key (twin)
languagestringLanguage default: "en"
modeenum"analyze", "training", "jobs", or "all" default: "analyze"
namespacesstringCompass namespaces for training mode default: "Laurea,Stadin"
areastringCity for jobs mode
countrystringCountry for jobs mode default: "fi"
headai_foresight_agentcompositeread-only

Produces an anonymised, aggregated skills picture of an organisation. The employer NEVER sees individuals. Hard-blocks if consenting participants < min_n (default 5) to prevent individual inference.

Chains: DigitalTwin get (per employee) → JoinGraphs → Scorecard (optional) → BuildSignals (optional)

ParameterTypeDescription
employee_keys requiredstringComma-separated Digital Twin keys for all employees
excluded_keysstringComma-separated opt-out twin_keys
min_nnumberMinimum consenting employees (hard block) default: 5
employer_needs_textstringFree text describing employer skill needs for gap analysis
languagestringLanguage default: "en"
include_signalsbooleanCompute BuildSignals for trend overlay default: false
include_quick_opportunitiesbooleanRun strategic gap analysis default: true

Utility & admin

headai_check_build_statusread-only

Poll async build status. Polls internally for up to 45 seconds and returns when ready. Call immediately after a build tool returns "building".

ParameterTypeDescription
status_url requiredstringStatus URL returned by the build tool
graph_urlstringDirect graph URL to check
headai_estimate_sizeread-only

Check data availability for a dataset before building. Only needed when the user specifically asks about data size.

ParameterTypeDescription
dataset requiredstringDataset name
search_textstringKeywords to filter
languagestringLanguage default: "en"
search_yearstring|numberYear filter
country / citystringLocation filter
headai_fetch_graphread-only

Retrieve raw graph JSON by URL. Low-level debug tool.

ParameterTypeDescription
url requiredstringFull URL to the graph JSON
headai_fetch_and_saveread-only

Fetch graph JSON and save to a local file. Returns compact summary + saved file path.

ParameterTypeDescription
url requiredstringFull URL to the graph JSON
save_path requiredstringLocal file path (use /tmp/)
headai_list_token_endpointsread-only

List all API endpoints available for the current API key.

Endpoint: GET /Utils (action: get_token_endpoints)

No parameters.

headai_list_token_dataread-only

List all data built with your API key for a specific endpoint.

Endpoint: GET /Utils (action: get_token_data)

ParameterTypeDescription
endpoint requiredstringEndpoint name: "BuildKnowledgeGraph", "Scorecard", "BuildSignals", etc.

Orchestration

headai_get_playbookread-only

Returns the full orchestrator playbook with tool-chaining logic, dataset rules, and workflow patterns. Call first at the start of each conversation.

No parameters. Returns static instructions.

Datasets

Knowledge graphs can be built from these real-world data sources:

DatasetContentTime horizonRequires search_year
job_adsJob postings from Finnish & EU job boardsPresent / recentNo
curriculumUniversity curricula from 15+ Finnish institutionsEducationNo
theseusFinnish thesis repositoryEducationNo
doaj_articles / doajOpen access academic journals (DOAJ)5-10yr futureYes
investment_data / investmentsStartup / VC funding data1-3yr futureYes
tiedejatutkimusFinnish research portal (research.fi)ResearchYes
newsInternational news sourcesCurrentYes

Note: v2 engine uses slightly different dataset names — "doaj" instead of "doaj_articles", "investments" instead of "investment_data".

Ontologies

OntologyEN termsFI termsNotes
headai168,83351,432Default. Best general-purpose
esco136,17536,287EU standard skills taxonomy
headai_optimized53,95823,360Compressed / faster variant
lightcastSupports additional_data=true

Usage examples

1. Build a knowledge graph from job ads

"What AI skills are Finnish employers looking for?"

Tool: headai_build_knowledge_graph_v2
{
  "dataset": "job_ads",
  "search_text": "artificial-intelligence,machine-learning,deep-learning,neural-networks,NLP,computer-vision,data-science",
  "country": "fi",
  "language": "en",
  "size": 200
}

2. Compare curriculum vs. job market

"How well does our data science program match employer needs?"

Build two graphs, then use Scorecard:

Tool: headai_scorecard_v2
{
  "map_url_1": "https://megatron.headai.com/analysis/.../curriculum.json",
  "map_url_2": "https://megatron.headai.com/analysis/.../job_market.json",
  "legend_1": "Data Science Curriculum",
  "legend_2": "Employer Demand",
  "language": "en"
}

3. Detect trending skills over time

"How have cybersecurity skills evolved 2022-2025?"

Tool: headai_build_signals
{
  "urls": "https://.../cyber_2022.json,https://.../cyber_2023.json,https://.../cyber_2024.json,https://.../cyber_2025.json",
  "map_legends": "2022,2023,2024,2025",
  "predict": true
}

4. Get career recommendations

"I know Python, SQL, and pandas. What should I learn for data engineering?"

Tool: headai_compass
{
  "skills": ["python", "sql", "pandas", "data analysis", "statistics"],
  "interests": ["data engineering", "data pipelines", "cloud computing"],
  "namespace": "any",
  "request": ["match", "zpd"]
}

5. Cross-source horizon analysis

"What does the future look like for autonomous vehicles?"

Combine job_ads (now) → investment_data (1-3yr) → doaj_articles (5-10yr) into a signals analysis to see which skills are emerging across all horizons.

Troubleshooting

Empty results from BuildKnowledgeGraph

doaj_articles, investment_data, news, and tiedejatutkimus datasets require the search_year parameter. Without it, they return empty.

Compass timeout

Compass has a 320-second timeout due to intensive computation. Only 1 concurrent Compass request per API key (Megatron has 2 cores per key). The server sends progress heartbeats to keep the connection alive.

search_text formatting

Commas (,) mean OR — each term is searched independently. Hyphens (-) mean AND — both words must appear together. Use 5-20 domain-specific terms for best results. Example: "machine-learning,deep-learning,neural-networks,NLP,computer-vision"