Guides / End-to-end tutorials / Autonomous MCP agent A–Z
Autonomous MCP agent A–Z
Connect Claude, Cursor or a custom TypeScript MCP client to Hosted Remote MCP or @tikultra/mcp, load compliance-grounded research prompts, enforce a hard credit cap, and emit a structured report.
1. Agent guardrails, prompts & spend cap
Point hosted agents at https://mcp.tikultra.com/mcp?profile=core&max_credits=250 or spawn npx -y @tikultra/mcp locally with TIKULTRA_MAX_CREDITS=250. Load legitimate_research_guidelines and a domain workflow prompt (tiktok_shop_market_research) before calling tools so the model plans its credit spend up front and has zero access to signing endpoints.
2. Runnable MCP client & multi-tool workflow
TypeScript SDK + MCPPython (MCP HTTP)Claude Code / cURLmcp_agent
1import { Client } from '@modelcontextprotocol/sdk/client/index.js'
2import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'
3
4const transport = new StreamableHTTPClientTransport(
5 new URL('https://mcp.tikultra.com/mcp?profile=core&max_credits=250'),
6 { requestInit: { headers: { 'x-api-key': process.env.TIKULTRA_KEY! } } },
7)
8const mcp = new Client({ name: 'shop-analyst', version: '1.0.0' })
9await mcp.connect(transport)
10
11// 1. Load compliance guardrails + Shop research workflow prompt + pricing resource
12const policy = await mcp.getPrompt({ name: 'legitimate_research_guidelines' })
13const plan = await mcp.getPrompt({ name: 'tiktok_shop_market_research', arguments: { keyword: 'portable espresso', region: 'US' } })
14const tiers = await mcp.readResource({ uri: 'tikultra://pricing/credit-tiers' })
15
16// 2. Execute budgeted multi-tool trace (100 / 250 max credits)
17const search = await mcp.callTool({ name: 'tikultra_shop_search', arguments: { keyword: 'portable espresso', region: 'US', count: 10 } })
18const pdp = await mcp.callTool({ name: 'tikultra_shop_pdp', arguments: { product_id: '1729487391071113352', region: 'US' } })
19const reviews = await mcp.callTool({ name: 'tikultra_shop_reviews', arguments: { product_id: '1729487391071113352', region: 'US', count: 20 } })
20const tako = await mcp.callTool({ name: 'tikultra_tako_ask', arguments: { query: 'Pros and cons of portable espresso makers?', region: 'US' } })
21
22console.log({ promptsLoaded: [policy.description, plan.description], tiers: tiers.contents.length, stepsCompleted: 4, tako })
23await mcp.close()
3. Execution trace & structured report output
| Step | MCP call | Purpose | Credits |
|---|---|---|---|
| 1 | prompts/get · legitimate_research_guidelines | Load acceptable-use & budget instructions | Free |
| 2 | resources/read · tikultra://pricing/credit-tiers | Inspect tier costs before invoking tools | Free |
| 3 | tools/call · tikultra_shop_search | Rank top US Shop listings for keyword | 25 cr |
| 4 | tools/call · tikultra_shop_pdp | Extract SKU price bands, stock & seller score | 25 cr |
| 5 | tools/call · tikultra_shop_reviews + tikultra_tako_ask | Synthesize verified buyer pros/cons & cited videos | 50 cr |
Hard spend ceiling. Once cumulative tool calls reach
max_credits (or TIKULTRA_MAX_CREDITS), the MCP server refuses further billable calls with a structured budget summary so the model can finalize its Markdown/JSON report cleanly without overspending.