Blog
Connect your AI agent to AI City
Give your agent an API key and it can launch cities, propose residencies and apply to them for you. You still sign every transaction.
Everything you can do on AI City, your agent can now do for you. That covers launching a pop-up city, running its core team, proposing a residency, reviewing applicants, applying for a bed, keeping your profile up to date and filling in a residency's knowledge base. It works with Claude Code, Claude Desktop, Cursor, or any agent that can make an HTTP request.
One thing doesn't change: your agent never holds your wallet. When money moves, the agent prepares the exact transaction and you sign it. The key you give it can't spend a cent.
Step 1: create an API key
- Sign in with your wallet and verify with World ID (/verify). Launching, proposing and applying need a verified human, and your agent inherits your status.
- Open your profile and scroll to Agent access.
- Name the key after the agent that will use it ("Claude on my laptop") and click Create key.
- Copy the key. It starts with
aic_and is shown once. Store it like a password, for example in an environment variable:
export AICITY_API_KEY=aic_…Step 2: connect your agent
Claude Code
claude mcp add --transport http ai-city https://aicity.cyou/api/mcp \
--header "Authorization: Bearer $AICITY_API_KEY"Run /mcp in Claude Code to check that ai-city is connected. You should see 40 tools.
Claude Desktop, Cursor and other MCP clients
Add this to the client's MCP config, with your key in place of aic_…:
{
"mcpServers": {
"ai-city": {
"type": "http",
"url": "https://aicity.cyou/api/mcp",
"headers": { "Authorization": "Bearer aic_…" }
}
}
}Any other agent: the skill file
If your agent doesn't speak MCP, point it at aicity.cyou/skill.md and give it the key. The skill file describes every flow over plain HTTP, and the agent sends the key as Authorization: Bearer aic_…. It's also a standard skill with name and description frontmatter, so you can install it into agents that load skills.
Step 3: ask it to do something
Start by checking the connection:
"Use ai-city's whoami. Am I verified?"
Then give it real work:
- Launch a city. "Launch a pop-up city called Kuching Builders Month in Kuching, Sarawak, from 1 to 30 November. Here's the mission…" Your agent shows you exactly what it will publish before it calls
launch_city. - Propose a residency. "Propose a two-week hacker house in that city: two shared rooms with four bunks at 400 USDC each, minimum six guests." It builds the rooms, beds and prices, checks the dates fit inside the city, and submits the proposal to the core team.
- Run the city. "Show me the proposals waiting for review in my city", then "approve #12 with a note".
- Apply. "Find residencies in Edge City Goa with a private room under 900 USDC and apply to the best one with my profile."
- Host. "Summarise the applicants for my residency and tell me who fits." You decide; the agent carries it out.
How money works: prepare, sign, record
Deploying a residency, approving a guest for a bed, paying for your bed, withdrawing against a receipt and claiming a refund are all onchain. For each one the agent calls prepare_transaction, and AI City returns:
- the exact transactions to sign, with a one-line summary of each ("Pay 400 USDC for bed 3");
- a link to the page where you can do the same thing in one click;
- what the agent should report back once it's mined.
The server checks the same rules as the contract before building anything: that you're the host, that the residency is still open, that you hold enough USDC, that the price matches what you were approved at. If something's wrong, your agent gets a plain-language reason instead of a failed transaction. You open the link, sign in your wallet, and the agent checks the result against the chain.
The contracts are unaudited. A good agent will tell you that before you pay, and ours are instructed to.
What your agent can't do
| Action | Why it stays with you |
|---|---|
| Sign in, create or revoke keys | Proves you own the wallet. A key can't mint more keys. |
| World ID verification | Proves a unique human over 18. No agent can fake it. |
| Sign transactions | Only your wallet can move your money. |
If a key leaks, revoke it under Agent access. From the next request on, it's treated as signed out.
Reference
- Docs: For agents, covering keys, the MCP server, and the full tool table
- /skill.md: the agent skill, with every HTTP call and MCP tool
- /skills/mcp.md: MCP setup and all 40 tools
- /skills/transactions.md: every onchain action, prepare → sign → record