Agentic AI with MCP
具有模型上下文协议(MCP)的代理人工智能
该项目实现了一个 Agentic AI 系统,该系统通过自定义模型上下文协议 (MCP) 服务器将 Groq 托管的 LLM(qwen-qwq-32b 模型)与各种工具连接起来。该系统通过提供来自维基百科、互联网搜索(通过 Tavily API)和金融数据(通过 Yahoo Finance API)的上下文信息来增强 LLM 的功能。
关于 MCP
模型上下文协议 (MCP) 是由 Anthropic 开发的一项开放标准,旨在规范应用程序向大型语言模型 (LLM) 提供上下文的方式。它促进了 LLM 应用程序与外部数据源和工具之间的无缝集成,使 AI 系统能够通过标准化接口与各种服务动态交互。
MCP 的主要特点:
标准化:为人工智能助手与结构化工具和数据层之间的连接提供通用协议。
模块化架构:遵循持久流上的客户端-服务器模式,通常由主机 AI 系统介导。
动态自省:支持通过 tools/list 和 resources/list 等方法动态发现工具和资源。
安全性:集成主机介导身份验证并支持安全传输协议。通过采用 MCP,开发人员可以构建更具互操作性、安全性更高且能够处理复杂工作流程的 AI 应用程序。
要向 MCP 服务器添加新工具:
定义工具:创建一个处理特定任务或数据检索的新功能。
注册工具:更新服务器的工具注册表以包含新功能,指定工具的名称和描述。
处理请求:确保服务器可以根据查询将传入的请求路由到适当的工具。这种模块化方法可以轻松扩展服务器的功能,使语言模型能够访问更广泛的上下文信息。
Related MCP server: Wikipedia MCP Server
特征
MCP 服务器:提供各种工具访问的中央枢纽
三个集成工具:
维基百科搜索——用于事实信息检索
互联网搜索 - 由 Tavily API 提供支持,可提供全面的网络结果
Yahoo Finance API - 用于实时股票和财务数据
Groq API 集成:使用 qwen-qwq-32b 模型进行超快速 LLM 处理
客户端-服务器架构:工具管理和 LLM 交互之间的明确分离
先决条件
开始之前,请确保您已具备以下条件:
安装
克隆存储库:
git clone https://github.com/dev484p/AgenticAI_MCP cd AgenticAI_MCP安装依赖项:
uv add "mcp[cli]"设置环境变量:在 keys.json 中更新 Groq 和 Tavily api 密钥
可选(使用 MCP Inspector 运行服务器进行开发):
uv run mcp dev server.py运行以下命令来启动聊天机器人:
uv run client.py
可用工具
系统通过MCP服务器提供三种工具:
维基搜索:
访问维基百科信息
示例查询:“告诉我人工智能的历史”
互联网搜索(塔维利):
获得全面的网络搜索结果
示例查询:“量子计算的最新发展是什么?”
雅虎财经:
获取股票价格和财务数据
示例查询:“AAPL 股票的当前价格是多少?”
参考
Available Tools
3 toolsinternet_searchC
Search the internet using Tavily API.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No | ||
| include_raw_content | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the Tavily API but doesn't describe key traits like rate limits, authentication needs, response format, or error handling. This is inadequate for a tool that performs external searches with potential constraints.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It's front-loaded with the core purpose, making it easy to parse quickly, though this brevity contributes to gaps in other dimensions.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (external API search with 3 parameters), lack of annotations, and no output schema, the description is incomplete. It doesn't cover behavioral traits, parameter meanings, or return values, making it insufficient for reliable agent use.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the schema provides no parameter details. The description adds no information about parameters like 'query', 'limit', or 'include_raw_content', failing to compensate for the coverage gap. This leaves the agent without semantic understanding of inputs.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search') and target ('the internet'), and mentions the specific API ('Tavily API'), which provides implementation context. However, it doesn't explicitly differentiate from sibling tools like 'wiki_search' or 'yahoo_finance_search' beyond the general internet scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus the sibling tools ('wiki_search' and 'yahoo_finance_search'). The description lacks any context about appropriate use cases, exclusions, or alternatives, leaving the agent without direction on tool selection.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
wiki_searchC
Search Wikipedia for articles.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| limit | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a search operation but doesn't describe what the search returns (e.g., article summaries, links), whether it has rate limits, authentication needs, or any constraints like language or date ranges. This leaves significant gaps in understanding the tool's behavior.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words, making it easy to parse. It's front-loaded with the core action and resource, though it could benefit from additional context to improve usefulness without sacrificing brevity.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the lack of annotations and output schema, the description is incomplete. It doesn't address the tool's complexity (a search operation with parameters), leaving the agent unsure about return values, error handling, or how results are structured. For a tool with 2 parameters and no structured output, more detail is needed to be fully helpful.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 0%, so the description must compensate, but it adds no information about parameters. It doesn't explain what 'query' should contain or that 'limit' controls the number of results, leaving both parameters undocumented beyond their schema definitions. However, with only 2 parameters and a default for 'limit', the baseline is slightly higher.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action ('Search') and resource ('Wikipedia for articles'), making the purpose immediately understandable. It doesn't differentiate from sibling tools like 'internet_search' or 'yahoo_finance_search', which would require mentioning Wikipedia specifically as the search target versus broader internet or finance searches.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention that it's for Wikipedia-specific searches as opposed to general internet searches or finance-related searches, nor does it specify any prerequisites or exclusions for usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
yahoo_finance_searchC
Get stock information from Yahoo Finance.
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | Yes | ||
| period | No | 1mo |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool 'gets' information, implying a read-only operation, but doesn't clarify if it's safe, requires authentication, has rate limits, or what kind of data it returns. For a tool with zero annotation coverage, this is insufficient to guide the agent's expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise and front-loaded, consisting of a single sentence that directly states the tool's purpose. There's no wasted language or unnecessary elaboration, making it efficient for quick understanding.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity (2 parameters, no annotations, no output schema), the description is incomplete. It doesn't cover parameter meanings, return values, or behavioral traits. While it states the basic purpose, it lacks the depth needed for the agent to use the tool effectively without additional context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no meaning beyond what the input schema provides. With 0% schema description coverage, both parameters ('symbol' and 'period') are undocumented in the schema, and the description doesn't explain what they represent, their formats, or valid values. This leaves the agent guessing about parameter usage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Get stock information from Yahoo Finance.' It specifies the verb ('Get') and resource ('stock information from Yahoo Finance'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'internet_search' or 'wiki_search', which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or any context for choosing this over general search tools. There's no information about prerequisites, limitations, or specific use cases, leaving the agent without usage direction.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
- First observed
internet_search - First observed
wiki_search - First observed
yahoo_finance_search
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: internet_search uses Tavily API for general web searches, wiki_search targets Wikipedia articles specifically, and yahoo_finance_search focuses on stock information from Yahoo Finance. There is no overlap in functionality or ambiguity between these three tools.
All tool names follow a consistent snake_case pattern with a clear verb_noun structure: internet_search, wiki_search, and yahoo_finance_search. The naming is uniform and predictable across the entire set.
With only 3 tools, the server feels thin for the broad domain implied by 'Agentic AI with MCP', which suggests a more comprehensive set of capabilities. While each tool is distinct, the count is borderline low for typical agentic AI tasks that might require more varied operations.
The tool surface is severely incomplete for an 'Agentic AI' server, as it only provides search functionalities without any CRUD operations, data processing, or other AI-related actions. There are significant gaps that will limit agent effectiveness, such as missing tools for data manipulation, analysis, or interaction with AI models.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
Related MCP Servers
- AlicenseBqualityBmaintenanceA Model Context Protocol server providing real-time stock data and options analysis through Yahoo Finance, enabling LLMs to access market data, analyze stocks, and evaluate options strategies.327MIT
- AlicenseBqualityCmaintenanceA Model Context Protocol server that retrieves information from Wikipedia to provide context to LLMs, allowing users to search articles, get summaries, full content, sections, and links from Wikipedia.222,859 PyPI299MIT
- AlicenseBqualityAmaintenanceA Model Context Protocol server that enables interaction with Yahoo Finance to retrieve stock pricing, company information, and historical financial data through natural language queries.211,290 PyPI28MIT
- AlicenseCqualityNot gradedmaintenanceA Model Context Protocol server that provides tools for interacting with Yahoo Finance, allowing users to retrieve stock prices, company information, and perform financial data comparisons.11MIT