shiyui-cosense-mcp
Provides read-only access to a Scrapbox (Cosense) project, enabling retrieval of pages, full-text search, semantic vector search, and related page discovery.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@shiyui-cosense-mcpsearch full text for 'OAuth setup'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
shiyui-cosense-mcp
https://scrapbox.io/shiyui 専用の read-only Remote MCP Server。
Cosense は公開 internal API へ匿名 GET
MCP endpoint は OAuth 必須
本人確認は Cloudflare Access for SaaS
Cloudflare Access policy は許可 email 1件 + One-time PIN
Cosense の本文・検索結果は保存しない
Cosense dataは保存せず、OAuth state、identity、code、token、grant、client metadataだけをWorkers KV
OAUTH_KVに保存
Tools
Tool | 用途 |
| titleを指定して本文を取得 |
| 通常本文を全文検索 |
| titleと本文中link記法をsemantic検索 |
| 1-hop / 2-hopの関連pageを取得 |
project、origin、URL、HTTP header、credential、file pathはtool引数に含めない。4 toolはすべて cosense:read scopeを要求する。
Related MCP server: Remote MCP Server on Cloudflare
Requirements
Node.js 24.11以上
pnpm 11.16.0
Cloudflare account
Cloudflare Access for SaaSを利用できるCloudflare Zero Trust account
One-time PINを受信するemail address 1件
Install
pnpm install --frozen-lockfile
pnpm checkpnpm-workspace.yaml は minimumReleaseAge: 10080 を設定し、直接・間接dependencyとも公開後7日未満のversionを拒否する。公開日時がnpm registryにないversionも拒否する。
Cloudflare Access
1. Access for SaaS application
Cloudflare Zero TrustでGeneric OIDCのSaaS applicationを作成する。
Redirect URI:
https://<worker-origin>/callbackPKCE: 有効
OIDC scope:
openid email profileIdentity provider:
One-time PINだけを有効化Access policy Include:
Emailsで許可email 1件Access policy Require:
Login MethodsでOne-time PIN
One-time PINだけを条件にしない。必ず完全一致のemail条件と組み合わせる。
作成後、次を控える。
Client ID
Client secret
Authorization URL
Token URL
JWKS URL
Access OIDC endpointは通常、次の形になる。
https://<team>.cloudflareaccess.com/cdn-cgi/access/sso/oidc/<client-id>/authorization
https://<team>.cloudflareaccess.com/cdn-cgi/access/sso/oidc/<client-id>/token
https://<team>.cloudflareaccess.com/cdn-cgi/access/sso/oidc/<client-id>/jwks2. Worker URL
wrangler.jsonc の MCP_SERVER_URL を公開するMCP URLへ変更する。
{
"vars": {
"MCP_SERVER_URL": "https://<worker-origin>/mcp"
}
}HTTPS、path /mcp、queryなし、fragmentなしのURLだけを受け付ける。
3. Secrets
本番用secret fileを作成し、値を設定する。
cp .prod.secrets.example .prod.secrets
openssl rand -hex 32生成値を .prod.secrets の COOKIE_ENCRYPTION_KEY に設定する。ALLOWED_EMAIL はAccess policyと同じemail addressにする。
本番secretを wrangler.jsonc、.prod.secrets.example、.dev.vars.example、Gitへ入れない。.prod.secrets とローカル用 .dev.vars はGit対象外である。
4. Deploy
初回はsecretとWorkerを1回のversionとしてdeployする。
pnpm exec wrangler whoami
pnpm exec wrangler deploy --secrets-file .prod.secrets以後、secretを変更しないdeployは pnpm deploy を使う。
OAUTH_KV は初回deploy時にWranglerが自動作成し、namespace IDを wrangler.jsonc へ書き戻す。書き戻された差分を確認する。
Verify
pnpm check
pnpm exec wrangler deploy --dry-run未認証requestが保護されていることを確認する。
curl -i https://<worker-origin>/mcp401 と WWW-Authenticate が返り、OAuth protected resource metadataが次を示すことを確認する。
resource:
https://<worker-origin>/mcpauthorization server:
https://<worker-origin>scope:
cosense:read
OAuth接続では、Access One-time PIN認証後にWorkerの同意画面が表示される。許可後、次を実機確認する。
tools/listが4 toolだけを返すget_pageが既存pageと未作成pageを区別する全文検索とvector検索の対象が異なる
1-hop paginationのcursorが次requestで使える
CosenseへAuthorization、Cookie、PAT、Service Account keyを送らない
ChatGPTでtool metadataを更新した場合は、app設定からMCP connectionをrefreshし、新しいconversationで確認する。
Local test
.dev.vars.example を .dev.vars へコピーし、test用値へ置き換える。
cp .dev.vars.example .dev.vars
pnpm devfixture testは外部Cosense、Cloudflare Access、ChatGPTへ接続しない。
.dev.vars.example の MCP_SERVER_URL はlocalhost用である。AccessとChatGPTを含むOAuth全体はdeploy後のHTTPS URLで確認する。
Token and secret lifecycle
対象 | 期限・更新 |
Access One-time PIN | 10分、1回使用。新しいPIN発行で以前のPINは無効 |
MCP access token | 1時間 |
MCP refresh token / grant | 30日 |
OAuth bridge state / consent state | 10分、1回使用 |
Access client secret | Access側でrotate後、Worker secretを更新 |
| 手動rotate。進行中の10分stateだけが無効 |
ALLOWED_EMAIL を変更して再deployすると、以前のemailへ発行したtokenは拒否される。Access policyだけを変更した場合、既発行のMCP grantは即時失効しない。全grantを失効する場合は、新しい空のKV namespaceへ OAUTH_KV bindingを切り替えて再deployする。旧namespaceは確認後に削除する。
Data and errors
Cosense APIは
GETとcache: "no-store"だけを使用一時stateにはOAuth request、PKCE verifier、nonce、
sub、email、name、scope、CSRFを最大10分保存するOAuth Providerの
propsは暗号化されるが、grant metadataのemail labelを含めOAUTH_KV全体を機密データとして扱うresponseにpage author、email、line ID、raw API responseを含めない
upstream error bodyをtool resultへ含めない
OAuth code、token、Cookie、page本文、queryをlogしない
vector
scoreの絶対thresholdを設けないfull-text / vectorの総件数やindex反映時間を保証しない
Cosense internal APIは予告なく変更される可能性がある
調査根拠と非採用機能は docs/research.md を参照する。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceThis server facilitates interaction with cosense/Scrapbox projects, enabling users to retrieve, list, search, and create pages while supporting various query operations and secure access to private projects.645149MIT
- Flicense-qualityCmaintenanceA Model Context Protocol server implementation designed to run on Cloudflare Workers with integrated OAuth authentication. It enables hosting and securely accessing MCP tools remotely via SSE transport from clients like Claude Desktop.
- AlicenseBqualityDmaintenanceEnables querying and interacting with a Markdown wiki generated from Confluence pages, with search and MCP server for LLM access.104MIT
- AlicenseAqualityCmaintenanceRead-only MCP server for self-hosted Confluence that lets AI agents search pages, fetch content, and navigate page trees via the REST API.57MIT
Related MCP Connectors
Agent-native MCP server over the public saagarpatel.dev corpus. Read-only, stateless.
MCP server for AgentDocs (agentdocs.eu): read, search, write, comment on & share Markdown docs.
Read-only MCP server for the WebAssembly spec: instructions, types, sections, search, proposals.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Sigumaa/shiyui-cosense-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server