Skip to main content
Glama
Shuxiabit

Mining Rights Daily Agent

by Shuxiabit

Mining Rights Daily Agent

CI Python 3.12 MCP License: MIT

一个面向矿业研究场景的 MCP(Model Context Protocol)作品:3 个独立 MCP Server 由 1 个 Agent Client 编排,生成带数据状态和引用源的中文矿权日报。

为什么选择这套设计

  • 可验证:新闻、资源量、价格响应共享统一数据契约。

  • 不装懂:线上数据源失败时返回 UNAVAILABLE;只有显式离线模式才使用 DEMO

  • 可演示:无 API Key、无外网也能跑完端到端流程。

  • 可扩展:每个数据域是独立 MCP Server,可接入 Claude Desktop、Cursor 或其他 MCP Client。

  • 安全边界清晰:外部 URL 仅允许公网 HTTP(S),并限制重定向、内容类型和响应大小。

Related MCP server: mining-rights-daily-agent

架构

Natural-language request
          |
          v
     Agent Client
       /   |   \
      v    v    v
  News   PDF   Price
   MCP   MCP    MCP
      \    |    /
       cited Markdown brief

MCP 工具

Server

Tool

说明

mining-news-mcp

search(query, days)

搜索近期公开矿业新闻

fetch_article(url)

提取公开网页正文

mineral-pdf-mcp

extract_resources(pdf_url)

抽取 Indicated/Inferred 资源量及页码证据

lme-price-mcp

get_price(commodity, date)

获取最近公开市场观测

get_trend(commodity, days)

获取序列并计算涨跌趋势

每个工具统一返回:

{
  "data": {},
  "source_url": "https://...",
  "retrieved_at": "ISO-8601 UTC",
  "data_status": "live | demo | unavailable",
  "error": null
}

快速开始

python -m pip install uv==0.11.23
uv sync --locked --extra dev

uv sync 会自动创建 .venv;CLI 会自动读取项目根目录中的 .env

离线确定性演示:

MINING_AGENT_OFFLINE=1 uv run python -m agent "给我生成一份关于 Pilbara 锂矿的今日简报"

Windows PowerShell:

$env:MINING_AGENT_OFFLINE="1"
uv run python -m agent "给我生成一份关于 Pilbara 锂矿的今日简报"

完整说明见 RUN.md,样例见 examples/pilbara-brief.md

项目文档

文档

内容

运行指南

Docker、本地 Python、模型配置和客户端接入

系统架构

组件关系、数据流、可靠性与扩展方向

数据契约

MCP 通用响应及各领域字段定义

设计决策

技术取舍、原因和已知限制

面试演示脚本

五分钟演示顺序与常见追问

贡献指南

开发、测试和提交约束

数据源与限制

  • 新闻:Google News RSS 搜索公开内容,Agent 会补取前 3 条新闻正文;受限页面返回不可用。

  • 资源量:pypdf 文本抽取与保守正则;支持从吨位和品位计算 Li2O、Cu 或 Au 金属量。

  • 价格:免费公开接口通常没有稳定的锂现货数据,因此系统披露所用期货/ETF 代理,绝不将代理冒充现货。

  • DEMO 只由 MINING_AGENT_OFFLINE=1demo:// 输入触发;线上异常不会自动替换成演示事实。

  • 目前支持 lithiumcoppernickelzinc;未知矿种会返回 UNAVAILABLE

测试

uv run ruff check .
uv run ruff format --check .
uv run mypy agent common mining_news_mcp mineral_pdf_mcp lme_price_mcp
uv run pytest --cov

20 项测试覆盖新闻/PDF/价格、SSRF 与响应限制、引用去重、MCP stdio 和离线端到端简报; 当前覆盖率门槛为 70%。 GitHub Actions 还会验证 Docker Compose、构建镜像、执行容器冒烟测试和 CodeQL 扫描。 依赖通过 uv.lock 固定,CI 与 Docker 均以 locked 模式安装,避免解析结果漂移。

安全

  • 密钥只通过环境变量读取,.env 已被 Git 忽略。

  • 不绕过登录墙、验证码或付费授权。

  • 外部文本只作为数据,不作为 Agent 指令。

  • 公网下载会校验 DNS/IP、每次重定向、Content-Type 和最大响应大小。

  • 仓库启用了 Secret Scanning、Dependabot 安全更新和 main 分支保护。

License

MIT

Available Tools

2 tools
fetch_articleA

Fetch readable article text from a public URL.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYes

TDQS

A3.5/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden of behavioral disclosure. It only states the core action and fails to mention important traits such as handling of non-article URLs, paywalls, redirects, or the exact format of the returned text.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant information. Every word contributes to the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one parameter, but the absence of an output schema and annotations leaves ambiguity about return values and edge-case behavior. The description is adequate for basic use but not fully complete for an agent to anticipate all outcomes.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema for 'url' has no description, and the description adds the qualifier that the URL must be public and that the resource is article text. This provides some meaning beyond the raw schema, but it does not detail URL validation, accepted formats, or error scenarios.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Fetch' and the resource 'readable article text' from a 'public URL', making the tool's purpose specific. It naturally distinguishes itself from the sibling 'search' by focusing on retrieving content from a given URL rather than discovering URLs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool (when you have a public URL and need article text) but does not explicitly mention alternatives or when not to use it. No exclusion criteria or comparison with the sibling 'search' is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A3.7/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one searches for news articles, the other fetches a specific article's content from a URL. There is no overlap or ambiguity between them.

Naming Consistency4/5

Both names start with lowercase verbs, but 'search' is a bare verb while 'fetch_article' follows a verb_noun pattern. The inconsistency is minor, but the names are clear and predictable in a small set.

Tool Count3/5

With only 2 tools, the set feels thin for a news-focused agent. However, the tools cover the essential search-and-read workflow without unnecessary clutter.

Completeness4/5

The pair supports the core flow of searching for mining news and fetching articles. Minor gaps exist, such as no filtering or aggregation, but the basic lifecycle is complete for a read-only news agent.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    Provides access to Chinese mainland financial data including A-stock quotes, financial statements, industry analysis, and macroeconomics through 42 MCP tools, with automatic data source fallback and no API key required.
    40
    Apache 2.0
  • F
    license
    Not graded
    quality
    C
    maintenance
    Provides web search, page fetching, and A-stock data access (financial reports, announcements, research reports, penalties, IR meetings) via MCP tools.
  • A
    license
    A
    quality
    B
    maintenance
    Deterministic A-share morning brief service exposing MCP tools to generate full market briefs, filtered news events, previous close context, and news coverage without external LLM keys.
    4
    Apache 2.0

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Shuxiabit/mining-rights-daily-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server