/agentkit:expose-agentkit-mcpfrom agentkit
Exposes AgentKit tools over MCP so a client can call them on one static mcp_server_url plus a per-run session token. Use when the user wants to expose AgentKit over MCP, generate a per-user MCP URL, or connect LangChain via MCP. It does not list connectors (that's `discover-connectors`) or create a connected account and call a tool in app code (that's `integrate-agentkit`).
Ships in agentkit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create an AgentKit MCP config, mint a per-run session token, and make one Streamable HTTP client call. Then stop.
connection_name). Never invent a slug. Never use a connector field for that value.mcp_server_url. Mint a session token per identifier and per run with create_session_token.SCALEKIT_ENVIRONMENT_URL, SCALEKIT_CLIENT_ID, and SCALEKIT_CLIENT_SECRET. Some samples use SCALEKIT_ENV_URL; use SCALEKIT_ENVIRONMENT_URL here. Do not prepend https:// if the value already has a scheme.list_mcp_connected_accounts auth links, not integrate-agentkit app-code execute_tool calls.create_session_token is remint. Call it again before the next run. Do not reuse a token from a previous session.github-connect. Every other connector, Gmail and Google Calendar included, needs its own connection in AgentKit → Connections. Record each name exactly.scalekit.actions.mcp (createConfig, listConnectedAccounts, createSessionToken).discover-connectors, before you put it in a config. Do not copy connector pages into the repo.Default path: Gmail plus Google Calendar, so one email fetch and one reminder event.
MY_CALENDAR → Save.Wait for the user to confirm both rows. Do not invent either name.
To test with no setup, map only github-connect and a GitHub tool such as github_user_repos_list.
Done when: Gmail and Calendar each have an exact dashboard Connection Name.
If the repo is Node, follow references/node.md from here.
If env vars are missing, collect them from app.scalekit.com → Developers → Settings → API Credentials. Put them in the project env file. Do not invent values.
pip install scalekit-sdk-python langgraph>=0.6.5 langchain langchain-openai langchain-mcp-adapters>=0.1.9 python-dotenv>=1.0.1
import os
import asyncio
from dotenv import load_dotenv
from scalekit import ScalekitClient
from scalekit.actions.models.mcp_config import McpConfigConnectionToolMapping
from langgraph.prebuilt import create_react_agent
from langchain_mcp_adapters.client import MultiServerMCPClient
load_dotenv()
sk_client = ScalekitClient(
client_id=os.getenv("SCALEKIT_CLIENT_ID"),
client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),
env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),
)
my_mcp = sk_client.actions.mcp
Set OPENAI_API_KEY in the environment for the LangChain client in Step 5.
Done when: the client initializes from those three env vars, and source files do not hardcode the secret.
Replace "gmail" and "MY_CALENDAR" with the recorded Connection Names. Create the config once. Reuse config_id and mcp_server_url.
cfg_response = my_mcp.create_config(
name="reminder-manager",
description="Summarizes latest email and creates a reminder event",
connection_tool_mappings=[
McpConfigConnectionToolMapping(
connection_name="gmail",
tools=["gmail_fetch_mails"],
),
McpConfigConnectionToolMapping(
connection_name="MY_CALENDAR",
tools=["googlecalendar_create_event"],
),
],
)
config_id = cfg_response.config.id
mcp_server_url = cfg_response.config.mcp_server_url
print("MCP server URL:", mcp_server_url)
Done when: config_id and a static mcp_server_url exist.
Replace "user_123" with the project's user id.
accounts_response = my_mcp.list_mcp_connected_accounts(
config_id=config_id,
identifier="user_123",
include_auth_link=True,
)
for account in accounts_response.connected_accounts:
print(
"Connection:", account.connection_name,
" Auth Link:", account.authentication_link,
" Status:", account.connected_account_status,
)
Tell the user to open every printed auth link and finish OAuth. A non-interactive run stops here until they do.
Done when: each mapped connection is authorized, or every needed auth link is printed.
from datetime import timedelta
token_response = my_mcp.create_session_token(
mcp_config_id=config_id,
identifier="user_123",
expiry=timedelta(hours=1),
)
token = token_response.token
async def main():
client = MultiServerMCPClient(
{
"reminder_demo": {
"transport": "streamable_http",
"url": mcp_server_url,
"headers": {"Authorization": f"Bearer {token}"},
},
}
)
tools = await client.get_tools()
agent = create_react_agent("openai:gpt-4o", tools)
response = await agent.ainvoke(
{"messages": "get 1 latest email and create a calendar reminder event in next 15 mins for a duration of 15 mins."}
)
print(response)
asyncio.run(main())
Done when: the Streamable HTTP client loads the tools and one invoke succeeds.
discover-connectors for live tool names and schemasintegrate-agentkit to create a connected account and call a tool in app codesetup-agentkit if the connection or env is missingWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub scalekit-inc/authstack --plugin agentkit6 skills in this plugin
/check-agentkit-prodChecks AgentKit go-live so an agent can sign off only when every item is PASS or WAIVE with a reason. Use when the user wants AgentKit production, or to go live AgentKit. It does not write a connected account or token (that's `integrate-agentkit`) or check SaaSKit go-live (that's `check-saaskit-prod`).
/discover-connectorsDiscovers AgentKit connectors from the live catalog and MCP so an agent can name tools and schemas. Use when the user asks what connectors exist, wants connector tools, or needs input/output schemas. It does not create a connected account or token (that's `integrate-agentkit`) or expose tools over MCP (that's `expose-agentkit-mcp`).
/Other plugins' skills for the same job