Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计提醒

tl-openmeter-api-mcp-serverTL openmeter API MCP server 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

242

周安装

10

GitHub Stars

公开资料未说明

下载量

79
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/toddlevy/tl-agent-skills --skill tl-openmeter-api-mcp-server

简介

tl-openmeter-api-mcp-server 用于辅助 API 设计、接口文档、请求响应结构和服务集成说明,适合梳理 endpoint 或生成 OpenAPI 草稿。

  • 适用于前后端联调和接口开发场景,需确认真实业务语义和鉴权方式。
  • 通过 npx skills add 命令从 GitHub 安装,支持主流 AI 宿主环境。
  • 涉及生成接口文档时应避免凭空补字段,安装前建议确认权限和维护状态。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

tl-openmeter-api-mcp-server

MCP server for your local OpenMeter instance: tools and resources so AI assistants (Cursor, Claude, etc.) can list meters, manage customers and subscriptions, query usage, and read the API quick reference.

Pair this with the tl-openmeter-api skill for knowledge; use this server to run operations against your OpenMeter.

Suite

SkillPurpose
tl-openmeter-apiREST API reference (knowledge)
tl-openmeter-local-devLocal dev setup: Docker, ngrok, Stripe App, webhooks
tl-openmeter-api-mcp-serverThis skill: MCP server for calling OpenMeter from Cursor

When to Use

  • "List my OpenMeter meters"
  • "Create a customer in OpenMeter"
  • "Query usage for this meter"
  • "Ingest a test event"
  • "Check if OpenMeter is running"
  • When you need the agent to actually call OpenMeter API (not just provide documentation)

Prerequisites

  • Node.js 18+
  • A running OpenMeter instance (e.g. Docker, default http://localhost:8888)

Installation

Step 1: Build the Server

From the skill directory:

npm install
npm run build

Step 2: Register in Cursor MCP Config

Add to ~/.cursor/mcp.json:

{
  "mcpServers": {
    "OpenMeter": {
      "command": "node",
      "args": ["C:\\Users\\Todd\\.cursor\\skills\\@tl-agent-skills\\skills\\tl-openmeter-api-mcp-server\\dist\\index.js"],
      "env": {
        "OPENMETER_URL": "http://localhost:8888",
        "OPENMETER_API_KEY": ""
      }
    }
  }
}

Adjust the path to match your installation location.

Step 3: Restart Cursor

Cursor needs to restart to pick up MCP config changes.

Environment Variables

VariableDefaultDescription
OPENMETER_URLhttp://localhost:8888Base URL of OpenMeter API
OPENMETER_API_KEY*(none)*Optional Bearer token for auth

Local dev often runs without OPENMETER_API_KEY.

Available Tools

ToolPurpose
openmeter_list_metersGET /api/v1/meters
openmeter_get_meterGET /api/v1/meters/{idOrSlug}
openmeter_query_usageGET /api/v1/meters/{idOrSlug}/query
openmeter_list_customersGET /api/v1/customers (paginated)
openmeter_get_customerGET /api/v1/customers/{idOrKey}
openmeter_create_customerPOST /api/v1/customers
openmeter_list_subscriptionsList subscriptions (optional customerId)
openmeter_create_subscriptionPOST /api/v1/subscriptions
openmeter_cancel_subscriptionPOST /api/v1/subscriptions/{id}/cancel
openmeter_list_plansGET /api/v1/plans
openmeter_list_featuresGET /api/v1/features
openmeter_get_entitlementsGET /api/v1/customers/{id}/entitlements
openmeter_ingest_eventPOST /api/v1/events (CloudEvents JSON)
openmeter_list_appsGET /api/v1/apps
openmeter_list_billing_profilesGET /api/v1/billing/profiles
openmeter_check_statusVerify connection to OpenMeter

Resources

  • OpenMeter quick reference — Markdown from the tl-openmeter-api skill
  • OpenMeter spec note — Plain text with spec URL and configured base URL

Verification

  1. Start OpenMeter (e.g. docker compose up or your stack)
  2. Ensure the OpenMeter MCP server is configured and enabled in Cursor
  3. In a chat, ask: "Check the OpenMeter status" or "List OpenMeter meters"
  4. The agent should call openmeter_check_status or openmeter_list_meters and return results

Errors (e.g. connection refused) are returned as tool results so the agent can report them.

Troubleshooting

ProblemCauseFix
Tools not availableServer not in mcp.jsonAdd config entry, restart Cursor
Connection refusedOpenMeter not runningStart OpenMeter (docker compose up)
401 UnauthorizedMissing API keySet OPENMETER_API_KEY in env
Server won't startNot builtRun npm run build in skill directory

MCP Design Principles

From anthropics/skills/mcp-builder:

Tool Naming

Use consistent, action-oriented prefixes:

openmeter_list_meters     ✓ (list action)
openmeter_get_customer    ✓ (get action)
openmeter_create_subscription ✓ (create action)
meters                    ✗ (no action prefix)

API Coverage vs Workflow Tools

Balance comprehensive API endpoint coverage with specialized workflow tools:

  • Comprehensive coverage gives agents flexibility to compose operations
  • Workflow tools (e.g., openmeter_provision_customer) combine multiple calls for common tasks

When uncertain, prioritize comprehensive API coverage.

Actionable Error Messages

Error messages should guide agents toward solutions:

// Bad
throw new Error('Request failed');

// Good
throw new Error(
  `OpenMeter customer not found: ${customerId}. ` +
  `Use openmeter_list_customers to find valid customer IDs.`
);

Pagination

All list operations support cursor-based pagination:

interface PaginationParams {
  page?: number;
  pageSize?: number;  // default: 100, max: 1000
}

interface PaginatedResponse<T> {
  items: T[];
  page: number;
  pageSize: number;
  totalCount: number;
}

Tool Implementation

server.registerTool({
  name: 'openmeter_list_customers',
  description: 'List customers with pagination. Returns page info and total count.',
  inputSchema: z.object({
    page: z.number().optional().describe('Page number (1-indexed)'),
    pageSize: z.number().max(1000).optional().describe('Items per page, max 1000'),
  }),
  async handler({ page = 1, pageSize = 100 }) {
    const response = await fetch(
      `${baseUrl}/api/v1/customers?page=${page}&pageSize=${pageSize}`
    );
    return {
      content: [{ type: 'text', text: JSON.stringify(await response.json()) }],
    };
  },
});

Batch Operations

Batch Event Ingestion

server.registerTool({
  name: 'openmeter_batch_ingest',
  description: 'Ingest multiple CloudEvents in a single request',
  inputSchema: z.object({
    events: z.array(z.object({
      type: z.string(),
      subject: z.string(),
      data: z.record(z.unknown()),
    })),
  }),
  async handler({ events }) {
    const cloudEvents = events.map(e => ({
      specversion: '1.0',
      id: crypto.randomUUID(),
      source: 'mcp-server',
      type: e.type,
      subject: e.subject,
      time: new Date().toISOString(),
      data: e.data,
    }));

    const response = await fetch(`${baseUrl}/api/v1/events`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/cloudevents-batch+json' },
      body: JSON.stringify(cloudEvents),
    });

    return { content: [{ type: 'text', text: `Ingested ${events.length} events` }] };
  },
});

Tool Annotations

Mark tools with hints for agent behavior:

server.registerTool({
  name: 'openmeter_create_customer',
  annotations: {
    readOnlyHint: false,      // Modifies state
    destructiveHint: false,   // Does not delete data
    idempotentHint: false,    // Creates new resource each time
    openWorldHint: true,      // External service interaction
  },
  // ...
});

server.registerTool({
  name: 'openmeter_list_meters',
  annotations: {
    readOnlyHint: true,       // Only reads data
    destructiveHint: false,
    idempotentHint: true,     // Same result for same input
    openWorldHint: true,
  },
  // ...
});

Testing

MCP Inspector

Test tools interactively:

npx @modelcontextprotocol/inspector

Mock Server for Tests

import { createMockMcpServer } from './test-utils';

const mockServer = createMockMcpServer({
  tools: {
    openmeter_list_meters: async () => ({
      content: [{ type: 'text', text: JSON.stringify([
        { id: 'test-meter', slug: 'api-calls', aggregation: 'COUNT' }
      ]) }],
    }),
  },
});

Integration Test Pattern

describe('OpenMeter MCP Server', () => {
  it('lists meters from running OpenMeter', async () => {
    const result = await server.callTool('openmeter_list_meters', {});
    expect(result.content[0].type).toBe('text');
    const meters = JSON.parse(result.content[0].text);
    expect(Array.isArray(meters)).toBe(true);
  });

  it('returns actionable error for invalid customer', async () => {
    const result = await server.callTool('openmeter_get_customer', {
      idOrKey: 'nonexistent'
    });
    expect(result.content[0].text).toContain('openmeter_list_customers');
  });
});

References

Quilted Skills

First-Party Documentation

MCP Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

37.57%
按下载量换算30

Claude

30.32%
按下载量换算24

Cursor

19.39%
按下载量换算15

Gemini CLI

9.99%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills