Use aifree in an AI agent
Our MCP server gives an agent the verified catalog: free tiers, credits, rate limits per model and what a student or a startup can claim, each answer with the offer page to cite. No key, no install for remote clients.
Endpoint https://aifree.dev/mcp (Streamable HTTP, stateless, no auth). Useful tools for an agent: search_free_ai_offers, find_models (which free API serves a model, at what RPM/RPD/TPM), check_eligibility, recent_changes and ask_aifree; the full list is on the developer page. Each setup below is run by a test against a local copy of the server on every change.
Claude Desktop
claude_desktop_config.json (Settings → Developer → Edit Config), then restart. It runs the stdio proxy; Node 18+. Alternatively: Settings → Connectors → Add custom connector with the URL below.
{
"mcpServers": {
"aifree": {
"command": "npx",
"args": ["-y", "@aifree/mcp"]
}
}
}Cursor
.cursor/mcp.json in the project (or ~/.cursor/mcp.json for every project). Any client that takes a remote MCP URL works the same way.
{
"mcpServers": {
"aifree": { "url": "https://aifree.dev/mcp" }
}
}OpenAI Agents SDK (Python)
The agent lists the tools over Streamable HTTP and calls them while it answers.
# agent.py - pip install openai-agents; needs OPENAI_API_KEY
import asyncio, os
from agents import Agent, Runner
from agents.mcp import MCPServerStreamableHttp
async def main():
url = os.environ.get("AIFREE_MCP_URL", "https://aifree.dev/mcp")
async with MCPServerStreamableHttp(
name="aifree", params={"url": url}, cache_tools_list=True
) as aifree:
agent = Agent(
name="Free AI scout",
instructions="Answer from the aifree tools only and cite each offer's url.",
mcp_servers=[aifree],
)
result = await Runner.run(agent, "Which free LLM APIs need no credit card?")
print(result.final_output)
asyncio.run(main())LangChain (JavaScript / TypeScript)
MCP tools become LangChain tools through @langchain/mcp-adapters; any chat model with tool calling works.
// agent.mjs - npm i langchain @langchain/mcp-adapters @langchain/openai
// needs OPENAI_API_KEY; the same code works as TypeScript
import { MultiServerMCPClient } from '@langchain/mcp-adapters'
import { createAgent } from 'langchain'
const client = new MultiServerMCPClient({
mcpServers: {
aifree: {
transport: 'http',
url: process.env.AIFREE_MCP_URL ?? 'https://aifree.dev/mcp'
}
}
})
const agent = createAgent({
model: 'openai:gpt-4.1-mini',
tools: await client.getTools(),
systemPrompt: "Answer from the aifree tools only and cite each offer's url."
})
const result = await agent.invoke({
messages: [{ role: 'user', content: 'Which free LLM APIs need no credit card?' }]
})
console.log(result.messages.at(-1).content)
await client.close()Without MCP
Agents with plain HTTP tools can call the JSON API (spec: https://aifree.dev/api/v1/openapi.json; request and response samples in curl, JavaScript, Python and Go on the API examples page). For reading rather than calling: llms.txt and llms-full.txt. The data is CC BY 4.0: cite the offer page each answer comes with.