不是
- 作者仓库星标 39
- 作者仓库 awesome-omni-skill
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @diegosouzapw · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 需要 · OpenAI / GitHub / Notion / Stripe
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
#!/usr/bin/env python3
"""
name: example-api
description: Fetch data from Example API
credentials:
- EXAMPLE_API_KEY
input:
query: string (required)
output:
results: list of matching items
"""
import json
import os
import sys
from urllib.request import urlopen, Request
def main():
# Read input
inp = json.load(sys.stdin) if not sys.stdin.isatty() else {}
# Get credentials (injected by notmcp run)
api_key = os.environ["EXAMPLE_API_KEY"]
# Make API call
query = inp.get("query", "")
req = Request(f"https://api.example.com/search?q={query}")
req.add_header("Authorization", f"Bearer {api_key}")
response = urlopen(req)
data = json.loads(response.read())
# Return result
print(json.dumps({"results": data["items"]}))
if __name__ == "__main__":
main()
# notmcp
You have access to a local toolbox of executable scripts. These tools let you interact with external APIs and services on behalf of the user.
## Discovering Tools
To see what tools are available:
```bash
~/.claude/skills/notmcp/bin/notmcp list
```
To search for tools by keyword:
```bash
~/.claude/skills/notmcp/bin/notmcp search <query>
```
## Running Tools
Run tools with JSON input:
```bash
~/.claude/skills/notmcp/bin/notmcp run <tool-name> --input '{"key": "value"}'
```
Tools return JSON to stdout. Exit code 0 means success.
If a tool doesn't need input, you can omit the `--input` flag:
```bash
~/.claude/skills/notmcp/bin/notmcp run <tool-name>
```
## Handling Credentials
If a tool needs credentials (API keys, tokens), it will fail with an error like:
```
Error: Missing credential(s): POSTHOG_API_KEY
```
When this happens:
1. Ask the user for the credential value
2. Store it securely:
```bash
echo "the-secret-value" | ~/.claude/skills/notmcp/bin/notmcp creds set CREDENTIAL_NAME
```
To see what credentials are already stored:
```bash
~/.claude/skills/notmcp/bin/notmcp creds list
```
## Connecting to Services
When the user wants to connect to a service, guide them **interactively, one step at a time**. Wait for the user to complete each step before proceeding to the next.
### Connection Process (Interactive)
**Step 1: Open the credentials page**
- Run `open "URL"` to open the page in their browser
- Tell them what page opened and wait for confirmation they see it
**Step 2: Guide them through the UI (one action at a time)**
- Give ONE instruction, then wait for them to do it
- Don't dump all steps at once - be conversational
- Example: "Click 'Generate new token'" → wait → "Now copy the token that appears"
**Step 3: Collect the credential**
- Ask them to paste the token/key
- Store it immediately when they provide it
**Step 4: Verify silently**
- Run a verification API call
- Only tell them if it fails - if it works, just confirm "Connected!"
### Important: Be Interactive
BAD (dumping everything):
```
Here's how to connect:
1. Go to URL
2. Click X
3. Click Y
4. Copy Z
5. Paste it here
```
GOOD (interactive):
```
I'll open the GitHub tokens page for you.
[opens browser]
Let me know when you see the page.
[user: "ok I see it"]
Click "Generate new token" at the top.
[user: "done"]
Now copy the token that appears and paste it here.
```
### Verifying Connections
After storing credentials, verify they work by making a simple API call:
- Most REST APIs have a /me, /user, or /auth endpoint
- Use the http-get tool or make a quick urllib request
- If it fails, troubleshoot with the user before proceeding
- If it works, just say "Connected!" - don't over-explain
### Common Services
**Google (Gmail, Drive, Calendar)** - App Password
- URL: https://myaccount.google.com/apppasswords
- Requires 2FA enabled on the account
- Guide: "Select 'Other (Custom name)', enter 'notmcp', click Generate"
- Store as: GOOGLE_APP_PASSWORD and GOOGLE_EMAIL
**GitHub** - Personal Access Token
- URL: https://github.com/settings/tokens/new?description=notmcp&scopes=repo,user
- Guide: "Click 'Generate token' and copy it"
- Store as: GITHUB_TOKEN
- Verify: GET https://api.github.com/user with Authorization header
**Slack** - Bot Token
- URL: https://api.slack.com/apps
- Guide: "Create New App → From scratch → OAuth & Permissions → Install to Workspace"
- Store as: SLACK_BOT_TOKEN
- Verify: POST https://slack.com/api/auth.test
**Notion** - Integration Token
- URL: https://www.notion.so/my-integrations
- Guide: "New integration → Name 'notmcp' → Copy the Internal Integration Secret"
- Store as: NOTION_TOKEN
- Remind user to share specific pages with the integration
**OpenAI** - API Key
- URL: https://platform.openai.com/api-keys
- Guide: "Create new secret key → Copy it"
- Store as: OPENAI_API_KEY
- Verify: GET https://api.openai.com/v1/models
**Linear** - API Key
- URL: https://linear.app/settings/api
- Store as: LINEAR_API_KEY
**Stripe** - Secret Key
- URL: https://dashboard.stripe.com/apikeys
- Store as: STRIPE_SECRET_KEY
### Other Services
For services not listed:
1. Search for their API or Developer documentation
2. Find where to create API keys or tokens
3. Guide the user through the process
4. Store with a descriptive name: {SERVICE}_API_KEY
5. Verify with a simple API call before building tools
## Using Context7 for API Documentation (Optional)
Context7 provides up-to-date API documentation. If CONTEXT7_API_KEY is set, fetch current docs before creating tools to avoid using outdated or hallucinated endpoints:
```bash
~/.claude/skills/notmcp/bin/notmcp run context7-docs --input '{"library": "googleapis/gmail", "topic": "send"}'
```
**To set up Context7:**
1. Open: https://context7.com/dashboard
2. Sign up (free) and copy your API key
3. Store: `echo "xxx" | ~/.claude/skills/notmcp/bin/notmcp creds set CONTEXT7_API_KEY`
Without Context7, you can still create tools using your knowledge, but results may be less accurate for newer APIs.
## Creating Tools
**Only create new tools when the user explicitly asks** (e.g., "save this as a tool", "make this reusable", "create a tool for this").
To create a new tool:
```bash
~/.claude/skills/notmcp/bin/notmcp create tool-name
```
This creates a template at `~/.claude/skills/notmcp/scripts/tool-name.py`.
Then edit the script to implement the tool logic. Follow these conventions:
### Tool Contract
- **Input**: JSON via stdin (parsed with `json.load(sys.stdin)`)
- **Output**: JSON to stdout (use `print(json.dumps(result))`)
- **Logs**: Write debug info to stderr
- **Exit code**: 0 for success, nonzero for failure
- **Dependencies**: Use Python stdlib only (`urllib.request`, `json`, `os`, etc.)
### Tool Header Format
Every tool must have a docstring header declaring its metadata:
```python
#!/usr/bin/env python3
"""
name: tool-name
description: What this tool does (one line)
credentials:
- API_KEY_NAME
- ANOTHER_SECRET
input:
param1: string (required)
param2: int (optional, default 10)
output:
result: description of output
"""
```
### Example Tool Structure
```python
#!/usr/bin/env python3
"""
name: example-api
description: Fetch data from Example API
credentials:
- EXAMPLE_API_KEY
input:
query: string (required)
output:
results: list of matching items
"""
import json
import os
import sys
from urllib.request import urlopen, Request
def main():
# Read input
inp = json.load(sys.stdin) if not sys.stdin.isatty() else {}
# Get credentials (injected by notmcp run)
api_key = os.environ["EXAMPLE_API_KEY"]
# Make API call
query = inp.get("query", "")
req = Request(f"https://api.example.com/search?q={query}")
req.add_header("Authorization", f"Bearer {api_key}")
response = urlopen(req)
data = json.loads(response.read())
# Return result
print(json.dumps({"results": data["items"]}))
if __name__ == "__main__":
main()
```
## Best Practices
1. **Handle pagination** - Don't return unbounded results. Implement limits and cursors.
2. **Handle rate limits** - Add delays or retry logic for APIs with rate limits.
3. **Return compact output** - Summarize large responses. Agents work better with concise data.
4. **Fail gracefully** - Return `{"error": "message"}` with a helpful error description.
5. **Use stdlib** - Avoid pip dependencies so tools are portable and self-contained.
章节与文件索引
按说明文件中的顺序排列。
发现工具
运行工具
处理凭证
连接到服务
连接过程(交互式)
文件/命令 -> --input · open "URL" · echo "xxx" | ~/.claude/skills/notmcp/bin/notmcp creds set CONTEXT7_API_KEY · ~/.claude/skills/notmcp/scripts/tool-name.py · json.load(sys.stdin) · print(json.dumps(result)) · urllib.request · {"error": "message"}
内容校验值 -> 9119734246e2
当前原文的自动摘译,尚未人工审校。
发现工具
要查看可用的工具: 要按关键字搜索工具:
运行工具
使用 JSON 输入运行工具:工具将 JSON 返回到标准输出。退出代码 0 表示成功。如果工具不需要输入,您可以省略
--input标志:处理凭证
如果工具需要凭据(API 密钥、令牌),它将失败并显示如下错误: 发生这种情况时: 询问用户凭据值 安全存储: 要查看已存储的凭据:
连接到服务
当用户想要连接到某项服务时,以交互方式引导他们,一次一步。等待用户完成每个步骤,然后再继续下一步。
连接过程(交互式)
第 1 步:打开凭据页面 运行
open "URL"在浏览器中打开该页面 告诉他们打开了哪个页面,并等待他们看到该页面的确认 第 2 步:引导他们完成 UI(一次一个操作) 给出一个指令,然后等待他们执行操作