Developer & MCP

Run Hadef AI from an agent. Any MCP client that speaks Streamable HTTP with a bearer header, or an agent of your own, can use the hosted MCP server. The REST API takes the same key. API and MCP access is included on every plan.

What the MCP server is

Hadef hosts a Model Context Protocol (MCP) server at https://hadef.io/mcp. It exposes research and pitch drafting as six tools. Your agent can start research on a guest, check progress, get the drafted LinkedIn message and email, list your prospects, record a send you made yourself, and read your credit balance, all without the web dashboard.

Hadef sends nothing. No tool delivers a message. You or your agent send the pitch from your own accounts, then record that with mark_pitch_sent.

Credits

One credit per completed run. Everything else is free. research_prospect needs enough credit to cover the new run and any run already in progress, and is refused if the balance cannot. The credit is spent once, when the run completes and the pitch is saved. check_status, get_pitch, list_prospects, mark_pitch_sent and get_credits never spend a credit.

For AI agents

There is one supported way to connect: the hosted MCP endpoint below. The REST reference is at /docs/api.

Get an API key

Generate a key below (you must be signed in), or from Settings → API. Keys are available on every plan. A key is shown once and looks like hdk_…. The same key authenticates the hosted MCP endpoint and the REST API. If you run out of credits, top up in Settings.

Your API keys

Connect: hosted MCP

Point any Streamable-HTTP MCP client at:

URL:    https://hadef.io/mcp
Header: Authorization: Bearer hdk_<your key>

The endpoint speaks JSON-RPC 2.0 and answers each POST with JSON. Discovery calls (initialize, tools/list, ping) need no key. tools/call requires your key. Only a completed research run spends a credit; every other call, including mark_pitch_sent, is free. The tool set is published at /.well-known/mcp/server-card.json.

curl -s https://hadef.io/mcp \
  -H "Authorization: Bearer hdk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call",
       "params":{"name":"research_prospect",
                 "arguments":{"linkedin_url":"https://linkedin.com/in/example"}}}'

Authentication is a static bearer header. There is no OAuth flow, so a client that can only connect to remote MCP servers through OAuth cannot use this endpoint. A local stdio server used in Hadef’s own development has a different tool list; it is not distributed and is not what this page documents.

Quick start

  1. Create an API key above, or in Settings → API.
  2. Add https://hadef.io/mcp to your MCP client with the header Authorization: Bearer hdk_<your key>.
  3. Call research_prospect with a LinkedIn URL, then poll check_status until status is no longer researching. If it ends as pitched or researched, call get_pitch.
  4. Send the message yourself from your own account, then call mark_pitch_sent to record it.

Tools

Six tools. Each name is what an MCP client passes to tools/call. Arguments are JSON. A result is a JSON string returned as MCP text content, shown pretty-printed below. A failed call returns isError: true with a plain message.

research_prospect

Start a research and pitch run for a guest. Returns at once with a prospect_id to poll. linkedin_url is required; name is optional. Refused when your balance cannot cover the run. Spends one credit when the run completes and the pitch is saved.

Example arguments
{
  "linkedin_url": "https://www.linkedin.com/in/jordanlee",
  "name": "Jordan Lee"
}
Example response
{
  "prospect_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "queued",
  "job_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "linkedin_url": "https://www.linkedin.com/in/jordanlee"
}

status is queued, or already_running when a run for that guest is already in progress.

check_status

Check a run and whether a pitch exists yet. Free.

Example arguments
{
  "prospect_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Example response
{
  "prospect_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "status": "pitched",
  "has_pitch": true,
  "updated_at": "2026-10-05T09:00:00+00:00"
}

status is researching while the run is in progress. Poll until it is anything else. A run ends in one of four statuses: pitched (a pitch was written and passed QA), researched (a pitch was written and did not pass QA), disqualified (not enough public material for a pitch, none written) or new (the run ended without a verdict, none written; you can run it again).

Wait on status, not on has_pitch. has_pitch only says that some pitch exists for the prospect. When you research a guest again, the pitch from the earlier run is still there while the new run is in progress, and it stays the latest pitch if the new run ends as disqualified or new.

get_pitch

Get the drafted LinkedIn message and the email for a prospect, once a pitch exists. It returns these two drafts and nothing else. Free.

Example arguments
{
  "prospect_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Example response (abbreviated)
{
  "pitch_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "status": "qa_passed",
  "linkedin_message": "… the drafted LinkedIn message …",
  "email_subject": "… the email subject …",
  "email_body": "… the drafted email …"
}

Read status before you send. It is qa_passed, qa_failed, or sent once you have recorded a send with mark_pitch_sent. A pitch that did not pass QA is still returned, with status set to qa_failed. get_pitch returns the latest pitch for the prospect, so call it after the run has ended.

list_prospects

List the prospects on your account, newest first. limit is optional: a whole number from 1 to 100, default 20. Free.

Example arguments
{
  "limit": 20
}
Example response
{
  "prospects": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "first_name": "Jordan",
      "last_name": "Lee",
      "title": "",
      "company": "",
      "status": "pitched",
      "created_at": "2026-10-05T08:52:00+00:00"
    }
  ]
}

mark_pitch_sent

Record that you sent a pitch yourself. It only records the send: Hadef delivers nothing, and the call is free. pitch_id is required and comes from get_pitch; channel is linkedin (default) or email. Calling it again for the same pitch changes nothing.

Example arguments
{
  "pitch_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "channel": "linkedin"
}
Example response
{
  "sent_at": "2026-10-05T09:12:00+00:00",
  "channel": "linkedin",
  "already_marked": false,
  "delivered_by_hadef": false
}

get_credits

Get the remaining credit balance on your account. Takes no arguments. Free.

Example arguments
{}
Example response
{
  "remaining": 9
}

REST reference: /docs/api. Explainer for answer engines: What is Hadef?