codebase-skill
4
总安装量
3
周安装量
#48245
全站排名
安装命令
npx skills add https://github.com/beyondeth/codebase-skills --skill codebase-skill
Agent 安装分布
gemini-cli
3
antigravity
3
claude-code
3
codex
3
continue
2
mcpjam
2
Skill 文档
Codebase.blog Auto-Posting (MCP + MCPorter)
This skill is OAuth-first and intended to be used via mcporter so non-developers can run blog auto-posting as plain commands.
What This Skill Does
- Authenticate once via OAuth (browser)
- Call MCP tools like normal commands
- Publish posts with
create_post - Optional image upload via presigned URL (
get_image_upload_url->curl PUT->finalize_uploaded_image)
Trigger Phrases
- ìëí¬ì¤í
- ìëí¬ì¤í í´
- í¬ì¤í í´ì¤
- ë¸ë¡ê·¸ í¬ì¤í í´ì¤
- ê¸ ë°íí´ì¤
- create post
- publish post
Routing Contract (Skill vs MCP Direct)
Use explicit user intent to choose one execution path. Do not mix both in one run.
Route Selection
skillroute (viamcporter): if user sayscodebase-skill,skill ì¬ì©,skillë¡,ì¤í¬ë¡, or uses style flags like--podcast,--research,--tutorial.mcproute (direct MCP tools): if user saysmcpë¡,MCP tool,codebase-blog-mcp,í´ë¡ ì§ì .- ambiguous phrase only (for example:
ìëí¬ì¤í í´): default toskillroute. - user can always override by adding one explicit token:
skillë¡ormcpë¡.
Route Guard
Before create_post, always run check_auth and validate the expected auth mode:
skillroute expected output:ì¸ì¦ ë°©ì : OAuth 2.1mcproute expected output:ì¸ì¦ ë°©ì : API Key
If mismatch:
- retry once on the correct route
- if still mismatched, stop and report route mismatch (do not post)
Preflight Log Line (required)
Print one route line before tool execution:
- skill route:
[Route] mode=skill transport=mcporter endpoint=/mcp-remote alias=codebase-blog-oauth - mcp route:
[Route] mode=mcp transport=direct endpoint=/mcp server=codebase-blog-mcp
Setup (Once)
# DEV (DEFAULT for this skill)
# - Safe default: prevents accidental production posting while testing.
npx -y mcporter config add codebase-blog-oauth \
--url http://localhost:3002/mcp-remote \
--auth oauth \
--allow-http \
--oauth-redirect-url http://127.0.0.1:33334/callback \
--scope project
# PROD (explicit opt-in)
npx -y mcporter config add codebase-blog-oauth-prod \
--url https://mcp.codebase.blog/mcp-remote \
--auth oauth \
--oauth-redirect-url http://127.0.0.1:33333/callback \
--scope home
# Browser OAuth (first time only)
npx -y mcporter auth codebase-blog-oauth
Verify (Always First)
Important: treat
check_authas the real success gate. Do not rely on the browser page text alone.
npx -y mcporter call codebase-blog-oauth.check_auth
Safe Gate (Recommended)
mcporter may print errors without a non-zero exit code. Gate on the presence of "error" in the output before posting.
AUTH_OUT=$(npx -y mcporter call codebase-blog-oauth.check_auth --output json 2>&1 || true)
echo "$AUTH_OUT"
if echo "$AUTH_OUT" | grep -q '"error"'; then
echo "[STOP] OAuth verification failed. create_post not executed."
exit 1
fi
Publish
npx -y mcporter call 'codebase-blog-oauth.create_post(
title: "ìëí¬ì¤í
í
ì¤í¸",
content_markdown: "## Hello\\n\\nmcporterë¡ ë°íí ê¸ì
ëë¤.",
category: "Tech",
tags: ["mcp","mcporter","automation"]
)'
Writing Style Guide (Optional)
npx -y mcporter call 'codebase-blog-oauth.get_writing_style_guide(style: "default")'
Image Upload (Optional)
# 1) ask for presigned URL
npx -y mcporter call 'codebase-blog-oauth.get_image_upload_url(mimeType: "image/webp", fileSize: 245760)'
# 2) upload with curl PUT (use uploadUrl from step 1)
curl -X PUT -H "Content-Type: image/webp" -T ./cover.webp "UPLOAD_URL_FROM_PREVIOUS_STEP"
# 3) finalize upload
npx -y mcporter call 'codebase-blog-oauth.finalize_uploaded_image(fileKey: "uploads/...", mimeType: "image/webp", fileSize: 245760)'
Troubleshooting
- If the login UI does not appear: you may already be logged in. Try a private window or
npx -y mcporter auth codebase-blog-oauth --reset. - If you see
SSE error: Invalid content type, expected "text/event-stream"duringmcporter auth: tokens may still be saved. Runcheck_authto confirm. - If port
33333is in use: pick another fixed callback port and re-add the server.