Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计提醒

build-mcp-use-agent构建 MCP USE Agent

Agent Skill

build-mcp-use-agent 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

364

周安装

15

GitHub Stars

5

下载量

119
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:build-mcp-use-agent(构建 MCP USE Agent)
来源仓库:https://github.com/yigitkonur/skills-by-yigitkonur
仓库路径:skills/build-mcp-use-agent
安装命令:
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill build-mcp-use-agent
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill build-mcp-use-agent

简介

用于构建基于 mcp-use 的 TypeScript AI Agent,支持从零开发或审计现有代码。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中驱动智能代理运行、流处理或事件监听。
  • 通过 npx skills add 命令从 GitHub 安装,需确认项目是否已存在相关依赖和结构。
  • 注意权限范围和维护状态,避免触发不必要的联网、命令执行或文件写入操作。
  • build-mcp-use-agent 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Build MCP Use Agent

Build production-grade TypeScript agents with MCPAgent from mcp-use. This skill drives both greenfield builds and audits of existing agent code.

Behavioral flow — what to do when this skill is invoked

Step 1 — Detect what exists

Run tree -L 3 or ls -R in the user's working directory. Look for signs of an existing mcp-use agent:

  • package.json with "mcp-use" as a dependency
  • Files importing MCPAgent from "mcp-use"
  • MCPAgent constructor calls
  • agent.run() / agent.stream() / agent.streamEvents() usage
  • LangChain model imports (@langchain/openai, @langchain/anthropic, etc.)

Step 2A — Existing mcp-use agent found

When you find an existing implementation, deploy four parallel subagents to explore and diagnose it. Each subagent must read the relevant reference files and surface three things: what is correct, what is wrong, and what is missing.

If the runtime cannot spawn subagents, do the same four audits sequentially in the order below and keep the same output contract.

Subagent 1 — Agent configuration audit Explore: constructor options, initialization mode (explicit vs simplified), LLM choice and provider, maxSteps setting, autoInitialize, prompt customization. Read: references/guides/agent-configuration.md, references/guides/llm-integration.md

Subagent 2 — Execution and output audit Explore: run() / stream() / streamEvents() / prettyStreamEvents() usage, structured output with Zod, memory management, multi-turn behavior. Read: references/guides/streaming.md, references/guides/structured-output.md, references/guides/memory-management.md

Subagent 3 — MCP server connections audit Explore: MCPClient configuration, server definitions, server manager usage, tool exposure settings, resource/prompt exposure. Read: references/guides/server-manager.md, references/guides/quick-start.md

Subagent 4 — Production readiness audit Explore: observability (metadata, tags, callbacks, Langfuse), error handling, lifecycle management (close(), flush()), anti-patterns. Read: references/guides/observability.md, references/patterns/production-patterns.md, references/patterns/anti-patterns.md, references/troubleshooting/common-errors.md

After all subagents report back:

  1. Synthesize findings into a prioritized list (critical issues first, then improvements, then nice-to-haves).
  2. Apply improvements directly — fix bugs, add missing cleanup, correct wrong signatures, improve configuration.
  3. Only ask the user if something is genuinely ambiguous (e.g., which LLM provider they want to switch to).

Step 2B — No existing mcp-use agent found

Check for context: is there an existing application that could benefit from an agent (e.g., an Express server, a CLI tool, a Next.js app)?

If context exists: Infer what kind of agent fits and build it. Read references/guides/quick-start.md and references/examples/integration-recipes.md for the right integration pattern. If the task is calculator-style and the repo does not already expose calculator tools, use the calculator server section in references/guides/quick-start.md before wiring the agent.

If no context exists: Ask the user up to 10 questions, each with 5+ concrete options:

  1. What LLM provider? (OpenAI gpt-4o, Anthropic claude-sonnet-4-6 or claude-opus-4-7, Google gemini-2.5-flash or gemini-2.5-pro, Groq llama-3.3-70b-versatile, other)
  2. Initialization mode? (Explicit — hand-built LLM and client, Simplified — "provider/model" string shorthand)
  3. What MCP servers to connect? (filesystem, database, custom stdio, remote HTTP/SSE, none yet)
  4. Output format? (plain text via run(), structured Zod schema, streaming steps, streaming tokens, pretty terminal)
  5. Memory behavior? (stateful multi-turn conversation, stateless single-shot, manual history injection)
  6. Need observability? (Langfuse auto-init, Langfuse custom endpoint, custom callbacks, none)
  7. Execution environment? (CLI script, HTTP handler, serverless function, Next.js route, REPL/chat loop)
  8. Max steps? (5 default, 10-20 for complex tasks, 30+ for code-mode workflows)
  9. Tool restrictions? (block dangerous tools via disallowedTools, inject extra tools via additionalTools, control resource/prompt surface via exposeResourcesAsTools / exposePromptsAsTools, no restrictions)
  10. Advanced needs? (code mode, server manager for multi-server routing, provider failover, none)

Then build the agent using the quick start patterns below and the relevant references.

Fast default for tiny, well-scoped tasks: if the task is simple and the working directory already makes the choice obvious, skip the long questionnaire and use these defaults unless the repo says otherwise:

  • simplified mode
  • llm: "openai/gpt-4o"
  • maxSteps: 10
  • memoryEnabled: false
  • autoInitialize: true
  • one clearly relevant MCP server only

Before the first run() / stream() / streamEvents() call, verify the provider key and every MCP server command or URL. Fix missing prerequisites first instead of debugging agent logic against a broken runtime.

Reference routing — curiosity-driven

Read these when the situation calls for it. Each trigger tells you *why* you would want that file.

Reference fileWhen your curiosity should lead you there
references/guides/quick-start.mdBuilding a first agent, choosing explicit vs simplified mode, creating a chat loop, or wiring an HTTP route. Start here for any greenfield build.
references/guides/agent-configuration.mdChoosing between explicit and simplified mode, or wondering what all the constructor options do and their defaults. Has the full MCPAgentOptions with accurate defaults (maxSteps=5, autoInitialize=false, memoryEnabled=true).
references/guides/llm-integration.mdSelecting a provider, using "provider/model" string shortcuts, switching providers at runtime, or validating model capabilities. Covers OpenAI, Anthropic, Google, Groq, and custom adapters.
references/guides/streaming.mdNeed streaming? There are 3 methods with very different signatures. All 3 accept the newer options-object form, and the plain-string overloads remain as deprecated compatibility helpers. Read this before implementing — getting the signatures wrong is the #1 streaming mistake.
references/guides/structured-output.mdStructured output with Zod schemas? The return types are AsyncGenerator, not AsyncIterable. Event payloads use event.data.output, not event.data. Read this for the correct patterns and the mcp-use-specific events (on_structured_output, on_structured_output_progress, on_structured_output_error).
references/guides/memory-management.mdMemory behavior matters in chat loops and multi-turn agents. Covers memoryEnabled, clearConversationHistory(), getConversationHistory(), externalHistory, and when to disable memory for stateless jobs.
references/guides/server-manager.mdMultiple MCP servers or dynamic activation. Covers useServerManager: true, the 5 built-in management tools, runtime server addition, and when NOT to use it.
references/guides/observability.mdTraces, callbacks, tags, metadata, and Langfuse. Covers auto-initialization via env vars, setMetadata(), setTags(), custom callback handlers, and flush() in serverless environments.
references/guides/advanced-patterns.mdCode mode, deep framework integrations, execution-heavy agents, and advanced strategies that go beyond the standard run/stream pattern.
references/patterns/production-patterns.mdHardening lifecycle, graceful shutdown, retries, logging, and deployment behavior. Read before shipping to production.
references/patterns/anti-patterns.mdReviewing an existing agent for correctness, maintainability, or safety regressions. Use during Step 2A audits.
references/examples/agent-recipes.mdCopyable end-to-end recipes beyond the quick start — interactive REPL, multi-server, typed output, and more.
references/examples/integration-recipes.mdNext.js + Vercel AI SDK, Express SSE, React frontend, Langfuse, multi-provider fallback, and dynamic server integrations.
references/troubleshooting/common-errors.mdWhen the agent fails to initialize, stream, call tools, or shut down cleanly. Check this before debugging from scratch.

Quick start

Explicit mode

Use when you need full control over the model instance, MCPClient, callbacks, or client options like code mode.

import { MCPAgent, MCPClient } from "mcp-use";
import { ChatOpenAI } from "@langchain/openai";

// MCPClient accepts a second MCPClientOptions argument for codeMode,
// onSampling, onElicitation, onNotification handlers. Omit it for plain agents.
const client = new MCPClient({
  mcpServers: {
    filesystem: {
      command: "npx",
      args: ["-y", "@modelcontextprotocol/server-filesystem", process.cwd()],
    },
  },
});

const llm = new ChatOpenAI({ model: "gpt-4o", temperature: 0 });

const agent = new MCPAgent({
  llm,
  client,
  maxSteps: 20,
  autoInitialize: true,
});

try {
  const result = await agent.run({
    prompt: "List the top-level files and summarize what each one does.",
  });
  console.log(result);
} finally {
  await agent.close();
}

Simplified mode

Use when you want the shortest correct setup. Pass llm as a "provider/model" string and mcpServers directly on the agent.

import { MCPAgent } from "mcp-use";

const agent = new MCPAgent({
  llm: "openai/gpt-4o",
  llmConfig: { temperature: 0 },
  mcpServers: {
    filesystem: {
      command: "npx",
      args: ["-y", "@modelcontextprotocol/server-filesystem", process.cwd()],
    },
  },
  maxSteps: 20,
  autoInitialize: true,
});

try {
  const result = await agent.run({ prompt: "List the top-level files." });
  console.log(result);
} finally {
  await agent.close();
}

Build sequence

  1. Pick explicit mode if you already have a LangChain model instance or need client options.
  2. Pick simplified mode for compact scripts and server routes.
  3. Set maxSteps deliberately — default is 5, which is low for most real tasks.
  4. Validate provider env vars and MCP server command/URL before the first execution call.
  5. If autoInitialize stays false, call await agent.initialize() or pre-create sessions before run() / stream() / streamEvents().
  6. Use object-form run({prompt,...}) for production code.
  7. Wrap every agent in try/finally with await agent.close().
  8. Add streaming only after the non-streaming path works.
  9. Add observability after the response path is stable.

Core API summary

Initialization modes

ModeRequiredWhen to useWhat mcp-use creates for you
Explicitllm (LangChain instance) + client or connectorsFull control over model, callbacks, client optionsNothing hidden
Simplifiedllm as "provider/model" string + mcpServersShortest working setupModel instance + client wiring

Key constructor options

For the full options table with all defaults, read references/guides/agent-configuration.md.

OptionTypeDefaultPurpose
llmLangChain model or "provider/model"requiredThe LLM to use (must support tool calling)
client / connectorsMCPClient / BaseConnector[]MCP server connection (explicit mode)
mcpServersserver config recordInline server config (simplified mode only)
llmConfigLLMConfigSimplified mode only — {apiKey, temperature, maxTokens, topP,...} forwarded to the LLM constructor
maxStepsnumber5Cap on tool-call loops
autoInitializebooleanfalsePre-connect sessions on construction
memoryEnabledbooleantrueStateful conversation across turns
systemPrompt`string \null`nullFull prompt override
systemPromptTemplate`string \null`nullOverride the default prompt template while keeping the tools/instructions scaffolding
additionalInstructions`string \null`nullLayer extra behavior on default prompt
disallowedToolsstring[][]Block dangerous or irrelevant tools (real access filter)
additionalToolsStructuredToolInterface[][]Inject extra LangChain tools alongside MCP-sourced tools
exposeResourcesAsToolsbooleantrueExpose MCP resources as callable tools
exposePromptsAsToolsbooleantrueExpose MCP prompts as callable tools
useServerManagerbooleanfalseMulti-server routing (advanced)
serverManagerFactory(client: MCPClient) => ServerManagerdefaultInject a custom ServerManager implementation
adapterLangChainAdapterdefaultOverride the MCP-tool → LangChain-tool adapter
observebooleantrueToggle observability manager wiring; set false to skip Langfuse even if env vars are set
callbacksBaseCallbackHandler[][]Langfuse or custom callback hooks
verbosebooleanfalseDebug logging
agentId / apiKey / baseUrlstringsSwitch to remote mode — proxies run/stream to an mcp-use remote runtime instead of executing locally (no local LLM or client needed)
toolsUsedNamesstring[][]Reporting field — seeds the post-run tools-used list. Not an access filter; use disallowedTools for that

run() signatures

StyleExampleWhen
Plain stringawait agent.run("Summarize...")Simple one-shot (deprecated overload)
Object formawait agent.run({prompt, maxSteps, manageConnector, externalHistory, schema, signal})Production, typed output, cancellation

RunOptions fields: prompt (required), maxSteps, manageConnector (defaults to true — pass false when the caller owns connector lifetime), externalHistory (override conversation history for this call), schema (Zod schema for typed output), signal (AbortSignal). Tags and metadata are agent-wide, not per-call — set them via agent.setTags([...]) and agent.setMetadata({...}) before calling run().

Streaming methods

MethodArgumentReturnsBest for
stream(...)string or options object`AsyncGenerator<AgentStep, string \T, void>`Step-by-step UIs, logs
streamEvents(...)string or options objectAsyncGenerator<StreamEvent, void, void>Token streams, raw events
prettyStreamEvents(...)string or options objectAsyncGenerator<void, string, void>ANSI terminal output

Critical: Prefer the options-object form for all three streaming methods: stream({prompt, maxSteps?, schema?, signal?}), streamEvents({prompt,...}), and prettyStreamEvents({prompt,...}). The plain-string overloads still work, but they are deprecated compatibility paths.

AgentStep type reference

Each step yielded by stream() represents one tool-call cycle. step.observation is empty ("") when yielded — tool results are tracked internally.

interface AgentStep {
  action: {
    tool: string;     // Tool selected by the agent
    toolInput: any;   // Arguments passed to the tool (any — could be string, object, etc.)
    log: string;      // LLM reasoning text — often empty in tool-calling agents
  };
  observation: string;  // Always "" at yield time
}

step.action.log is often empty in tool-calling agents because the model emits the intent through structured tool calls rather than reasoning text. The underlying LangChain runtime sometimes attaches messageLog: BaseMessage[] and toolCallId: string to the same action object — they are not declared on mcp-use's AgentStep, so cast to any to inspect them. Prefer those for correlating tool calls with on_tool_start / on_tool_end events emitted by streamEvents(). Also: do not JSON.stringify(step.action.toolInput) blindly — when it's already a string the result is double-encoded.

streamEvents() example

import { MCPAgent, MCPClient } from "mcp-use";
import { ChatOpenAI } from "@langchain/openai";

const agent = new MCPAgent({ llm: new ChatOpenAI({ model: "gpt-4o" }), client });

for await (const event of agent.streamEvents({ prompt: "Explain the architecture." })) {
  if (event.event === "on_chat_model_stream") {
    const text = event.data?.chunk?.text ?? event.data?.chunk?.content;
    if (typeof text === "string") process.stdout.write(text);
  }
}

Key streamEvents event types

EventDescriptionPayload
on_chat_model_streamEvery LLM tokenevent.data?.chunk?.text or .content
on_tool_startTool about to be calledevent.name, event.data.input
on_tool_endTool finishedevent.name, event.data.output
on_chain_start / on_chain_endAgent loop lifecycleevent.name, event.data.output
on_structured_output_progressSchema conversion progress (mcp-use specific)
on_structured_outputStructured output ready (mcp-use specific)event.data
on_structured_output_errorSchema conversion failed (mcp-use specific)event.data

Lifecycle methods

MethodPurposeWhen
initialize()Pre-connect sessionsAfter dynamic config changes
close()Graceful cleanupAlways in finally
flush()Send buffered tracesBefore close() in serverless
clearConversationHistory()Reset memoryBetween unrelated turns
setDisallowedTools(tools)Update tool restrictionsRuntime policy changes
setMetadata(metadata)Attach trace metadataLangfuse, request correlation
setTags(tags)Group and filter tracesObservability queries

Langfuse auto-initialization

When LANGFUSE_PUBLIC_KEY and LANGFUSE_SECRET_KEY env vars are set, mcp-use auto-initializes Langfuse tracing. No manual CallbackHandler import needed. Only use explicit callbacks for custom Langfuse endpoints.

flush() + close() in serverless

In serverless environments (Next.js API routes, Lambda, Cloud Functions), always flush before closing to ensure traces reach the backend:

try {
  const result = await agent.run({ prompt: "Inspect the repository." });
  return result;
} finally {
  await agent.flush();   // send buffered traces
  await agent.close();   // clean up sessions
}

Code mode note

codeMode is configured on MCPClient, not on MCPAgent. When the task involves code execution, wire the client first:

const client = new MCPClient(
  { mcpServers: { /* ... */ } },
  { codeMode: true }
);
const agent = new MCPAgent({ llm, client, maxSteps: 30 });

For advanced code-mode patterns, read references/guides/advanced-patterns.md.

Companion packages

mcp-use@1.25.0 requires LangChain v1 and Zod v4 as peers. The full mcp-use surface includes: MCPAgent, MCPClient, MCPSession, RemoteAgent, connector classes (StdioConnector, HttpConnector, BaseConnector), loadConfigFile, ServerManager, ObservabilityManager, Telemetry, OAuth helpers (BrowserOAuthClientProvider, onMcpAuthorization, probeAuthParams), code-execution ancillaries (BaseCodeExecutor, E2BCodeExecutor, VMCodeExecutor), elicitation helpers (accept, decline, reject, validate), and PROMPTS.

Declared peer dependencies

PackageRequired versionPurpose
@langchain/core^1.1.0LangChain v1 core types and message classes
@langchain/openai^1.2.0ChatOpenAI — pair with OPENAI_API_KEY
@langchain/anthropic^1.3.0ChatAnthropic — pair with ANTHROPIC_API_KEY
langchain^1.2.10LangChain v1 runtime
langfuse, langfuse-langchain^3.38.6Observability (auto-init when env vars set)
zod^4.0.0Structured-output schemas (Zod v4 required)
@e2b/code-interpreter^2.2.0Code-execution sandbox
react, react-router`^18

All @langchain/*, langchain, langfuse, langfuse-langchain, and @e2b/code-interpreter are marked optional in peerDependenciesMeta — install only the providers you actually use. zod, react, and react-router are strictly required.

Optional LLM adapters (NOT peer-declared)

PackagePurposeNote
@langchain/google-genaiChatGoogleGenerativeAIGOOGLE_API_KEYNot a peer dep — install only if using Gemini
@langchain/groqChatGroqGROQ_API_KEYNot a peer dep — install only if using Groq

Both must remain LangChain v1 compatible. The "google/..." and "groq/..." simplified-mode shorthands fail at runtime if the matching adapter is missing.

Other helpers

PackagePurpose
dotenvLocal dev env loading

If your codebase is on LangChain v0.x or Zod v3, plan the upgrade before adopting mcp-use@1.25.0 — peer-dep mismatches surface as runtime tool-calling failures and JSON-schema serialization bugs.

Provider quick reference

ProviderModelString shorthandPackagePeer?Env var
OpenAIgpt-4o"openai/gpt-4o"@langchain/openaipeer (optional)OPENAI_API_KEY
Anthropicclaude-sonnet-4-6"anthropic/claude-sonnet-4-6"@langchain/anthropicpeer (optional)ANTHROPIC_API_KEY
Googlegemini-2.5-flash"google/gemini-2.5-flash"@langchain/google-genaiNOT a peer depGOOGLE_API_KEY
Groqllama-3.3-70b-versatile"groq/llama-3.3-70b-versatile"@langchain/groqNOT a peer depGROQ_API_KEY

@langchain/google-genai and @langchain/groq are not declared peers of mcp-use@1.25.0; install them separately if you use those providers. Anthropic models: prefer claude-opus-4-7 for deep reasoning, claude-sonnet-4-6 for general MCP-agent workloads. Verify Google and Groq model IDs against their respective consoles before shipping — model IDs are deprecated frequently.

For full provider details, failover, and custom adapters, read references/guides/llm-integration.md.

Server manager quick reference

When useServerManager: true is set, the agent gains five built-in management tools:

ToolPurpose
list_mcp_serversList configured servers and their tools
connect_to_mcp_serverActivate a server and load its tools
get_active_mcp_serverCheck the currently connected server
disconnect_from_mcp_serverDeactivate and remove tools
add_mcp_server_from_configRegister a new server at runtime

For dynamic server switching and multi-server patterns, read references/guides/server-manager.md.

Rules

  1. Use import {MCPAgent, MCPClient} from "mcp-use" — never import from @modelcontextprotocol/sdk in agent code.
  2. Set maxSteps intentionally; explain the chosen value.
  3. Close the agent with await agent.close() in try/finally in every example.
  4. Put secrets in environment variables, never string literals.
  5. Use object-form run() in production code and typed flows.
  6. Prefer the options-object form for stream(), streamEvents(), and prettyStreamEvents(); the plain-string overloads still exist but are deprecated.
  7. Use the object form whenever you need schema, maxSteps, signal, or other per-call controls.
  8. prettyStreamEvents() also has a deprecated plain-string overload, but the object form is the stable shape to document and extend.
  9. step.observation is always empty at yield time — never claim it contains tool output.
  10. Call flush() before close() in serverless environments.
  11. Langfuse auto-initializes via env vars — do not manually wire CallbackHandler unless using a custom endpoint.
  12. Call client.closeAllSessions() when managing client lifetime separately from the agent.
  13. codeMode is configured on MCPClient, not on MCPAgent.
  14. Treat useServerManager as advanced — do not enable by default.
  15. Explain memory behavior whenever showing multi-turn code.
  16. Check both chunk.text and chunk.content for cross-provider streaming compatibility.
  17. Use mcp-use structured output events (on_structured_output, on_structured_output_progress, on_structured_output_error) — not generic LangChain events.

Common pitfalls

PitfallWhy it failsFix
Missing await agent.close()Sessions and sandboxes stay opentry/finally in every example
Mixing explicit and simplified modeInternally inconsistent codePick one mode
Assuming stream() rejects options objectsPublished mcp-use types accept RunOptionsPrefer agent.stream({prompt, maxSteps, schema, signal})
Passing plain string to streamEvents() with schemaNo way to pass schema or callbacksUse object form: agent.streamEvents({prompt, schema})
Reading step.observation during streamingAlways empty at yield timeLog only step.action.tool and step.action.toolInput
Leaving maxSteps at default 5Agent stops too early on real tasksSet explicitly per workload
Claiming codeMode is an agent optionIt belongs on MCPClientConfigure the client, pass to agent
Hard-coding API keysUnsafe to copyUse .env and process.env
Omitting flush() in serverlessTraces lost on process exitawait agent.flush() then await agent.close()
Checking only chunk.text or chunk.contentBreaks across providersCheck both: event.data?.chunk?.text?? event.data?.chunk?.content
Manual CallbackHandler for basic LangfuseUnnecessary boilerplateUse env var auto-initialization
Enabling useServerManager by defaultAdds complexity to simple agentsEnable only for multi-server routing
Forgetting client.closeAllSessions()Orphaned server processesCall in finally when you own the client
Passing tags / metadata inside RunOptionsNot fields of RunOptions — TypeScript rejects them, Langfuse never receives themUse agent.setTags([...]) / agent.setMetadata({...}) once, before run()
Using toolsUsedNames to narrow allowed toolsIt is a reporting field populated as the agent runs, not an access filterUse disallowedTools to remove tools, additionalTools to add, exposeResourcesAsTools / exposePromptsAsTools for the resource/prompt surface

Do / Don't

DoDon't
Use mcp-use imports in all examplesImport from @modelcontextprotocol/sdk in agent code
Use explicit mode for fine-grained controlHide important client configuration
Use simplified mode for getting-started pathsCombine explicit and simplified in one example
Show complete imports and cleanupLeave readers guessing about packages or shutdown
Explain defaults when they matterPresent options without operational guidance
Route advanced topics to reference filesInflate the quick start with every edge case
Pass {prompt: "..."} to stream()Default to the deprecated plain-string form
Pass options object to streamEvents() when you need schema or extensibilityUse plain string when you need structured output or callbacks
Call flush() before close() in serverlessSkip flush() and lose traces
Rely on Langfuse auto-init via env varsManually wire CallbackHandler for basic tracing
Call client.closeAllSessions() when owning clientLeave server processes running

Minimal reading sets

"I need a minimal agent now"

  • references/guides/quick-start.md
  • references/guides/llm-integration.md

"I need to choose constructor options"

  • references/guides/agent-configuration.md
  • references/guides/quick-start.md

"I need streaming output"

  • references/guides/streaming.md
  • references/examples/integration-recipes.md

"I need structured output"

  • references/guides/structured-output.md
  • references/guides/streaming.md

"I need observability and production safety"

  • references/guides/observability.md
  • references/patterns/production-patterns.md
  • references/patterns/anti-patterns.md

"I need advanced execution or code mode"

  • references/guides/agent-configuration.md
  • references/guides/advanced-patterns.md
  • references/examples/agent-recipes.md

"Something is broken"

  • references/troubleshooting/common-errors.md
  • references/patterns/anti-patterns.md

Guardrails

  • Do not import MCP SDK primitives directly — use mcp-use.
  • Do not omit cleanup from long-lived examples.
  • Do not describe codeMode as an MCPAgent constructor field.
  • Do not recommend raw streamEvents() when prettyStreamEvents() or stream() suffices.
  • Do not leave maxSteps unexplained in production examples.
  • Do not hard-code secrets in copyable snippets.
  • Do not enable useServerManager by default.
  • Do not answer with thin pseudo-code when runnable TypeScript is needed.
  • Do not add new reference files unless a topic cannot fit the routed structure.
  • Do not break the header and routing conventions of sibling build-mcp-use-* skills.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.64%
按下载量换算41

Claude

33.15%
按下载量换算39

Cursor

19.61%
按下载量换算23

Gemini CLI

9.24%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/yigitkonur/skills-by-yigitkonur --skill build-mcp-use-agent 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills