trocco-mcp-tools
OfficialThe server provides tools to audit TROCCO workflows and BigQuery datamarts, and perform controlled write operations on datamart definitions and jobs:
get_workflow— Fetch a TROCCO workflow definition bypipeline_definition_id(read-only).get_datamart— Fetch a BigQuery datamart definition, including SQL and metadata, bydatamart_definition_id(read-only).build_workflow_audit_payload— Combine a workflow and all its datamarts into a comprehensive audit payload, including SQL analysis, resolved destinations, write dispositions, risk flags (e.g., missing API destination, write disposition mismatch), and downstream references.create_datamart_definition— Create a new BigQuery datamart definition (requires explicit confirmation and a creation reason; safe mode enabled).update_datamart_definition— Update an existing datamart configuration (requires confirmation, a change reason, and supports optionalexpected_currentvalues for guarded updates; safe mode enabled).run_datamart_job— Execute an existing datamart definition (requires explicit confirmation and a run reason; safe mode enabled).
The server supports both stdio (local) and streamable HTTP transport (e.g., Cloud Run, ChatGPT integration).
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., "@trocco-mcp-toolsShow workflow 3847"
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.
trocco-mcp-tools
TROCCO API を Model Context Protocol (MCP) から扱うためのツール群です。TROCCO workflow と BigQuery datamart の差分監査に必要な情報を取得し、ChatGPT から監査エージェントが SQL、出力先、更新方式、依存関係、リスク候補を整理できる状態を目指します。現在は読み取り系を中心にしつつ、datamart definition / datamart job については明示的な安全条件付きの操作系ツールも提供します。
現在の優先方針
現在の最優先は、実監査そのものではなく、この TROCCO MCP server を ChatGPT から追加・接続できる状態にすることです。
進め方:
Cloud Run などに HTTP MCP endpoint を deploy する
TROCCO_API_KEYを安全に server 側へ注入するChatGPT から MCP server を追加する
ChatGPT から
build_workflow_audit_payloadを呼べることを確認する以後の監査は ChatGPT から MCP tool を利用して実行する
Related MCP server: APISIX Admin MCP Server
目的
このリポジトリでは、TROCCO と BigQuery を使った差分監査を支援するため、次の情報を MCP ツール経由で取得します。
workflow の基本情報
workflow task 一覧
task dependency 一覧
TROCCO BigQuery datamart task の definition id
datamart SQL
datamart の出力先 dataset / table
write_disposition、incremental_column、merge_keys、lookback_period などの更新設定
SQL から推定した source table / destination / write disposition
resolved destination / resolved write disposition
risk flags
downstream references
初期段階では監査に必要な読み取り系を主軸にし、操作系は BigQuery datamart definition と datamart job に限定します。workflow definition create/update と transfer definition create/update は、task/dependency 破壊リスクや connector 種別差が大きいため第2弾以降の対象です。
実装構成
Runtime: Node.js 20+
Language: TypeScript
MCP framework:
@modelcontextprotocol/sdkValidation:
zodStdio entry point:
src/index.tsHTTP entry point:
src/http.tsShared MCP server factory:
src/server.tsTROCCO API client:
src/troccoClient.tsSQL analysis:
src/sqlAnalysis.tsAudit model:
src/auditModel.tsSQL inventory model:
src/inventoryModel.tsHTTP smoke test:
scripts/smoke-http.mjsDatamart action smoke test:
scripts/smoke-datamart-actions.mjs
Transport
この repository では 2 種類の起動方式を持ちます。
stdio: Cloud Shell やローカルでの検証用
Streamable HTTP: ChatGPT / Cloud Run 接続用
HTTP endpoint:
GET /status: status checkPOST /mcp: MCP Streamable HTTP endpoint
MCP_AUTH_TOKEN を設定した場合、POST /mcp は Authorization: Bearer <token> または x-mcp-auth-token: <token> を要求します。
既定の監査対象
明示指定がない場合、監査エージェントは次の workflow を既定対象として扱います。
pipeline_definition_id=3847SH_PLUS_BQ_RAISE_data_daily_new
環境変数
TROCCO API 接続に必要な認証情報は環境変数から読み込みます。
TROCCO_API_KEY: TROCCO API keyTROCCO_BASE_URL: TROCCO API base URL。未指定時はhttps://trocco.ioを使いますPORT: HTTP server port。Cloud Run では自動設定されますMCP_AUTH_TOKEN: HTTP MCP endpoint 用の bearer tokenMCP_ENDPOINT: smoke test 用 MCP endpoint URLPIPELINE_DEFINITION_ID: smoke test 用 workflow id。未指定時は3847DATAMART_JOB_ID: datamart action smoke test 用 job id。未指定時は1
TROCCO API は Authorization: Token {{API KEY}} 形式の header で認証します。
セットアップ
npm install
npm run buildstdio server を起動します。
TROCCO_API_KEY=... npm run start:stdioHTTP server を起動します。
TROCCO_API_KEY=... MCP_AUTH_TOKEN=... npm run start:httpstatus check:
curl http://localhost:8080/statusCloud Run deployment
Secret Manager に TROCCO API key を保存します。
printf '%s' '<TROCCO_API_KEY>' | gcloud secrets create trocco-api-key --data-file=-MCP endpoint 用 token は trocco-mcp-auth-token として保存済みの前提です。未作成の場合だけ次を実行します。
openssl rand -hex 32 | gcloud secrets create trocco-mcp-auth-token --data-file=-Cloud Run に deploy します。
gcloud run deploy trocco-mcp-tools \
--source . \
--region asia-northeast1 \
--allow-unauthenticated \
--set-secrets TROCCO_API_KEY=trocco-api-key:latest,MCP_AUTH_TOKEN=trocco-mcp-auth-token:latestDeploy 後に確認します。
curl https://<cloud-run-url>/statusChatGPT に追加するときの MCP endpoint は次です。
https://<cloud-run-url>/mcpChatGPT 側の connector 設定では、trocco-mcp-auth-token と同じ値を bearer token として設定してください。
HTTP smoke test
Cloud Run deploy 後、ChatGPT に追加する前に MCP client で疎通確認します。
export MCP_ENDPOINT="https://<cloud-run-url>/mcp"
export MCP_AUTH_TOKEN="$(gcloud secrets versions access latest --secret=trocco-mcp-auth-token)"
npm run smoke:http期待する summary:
{
"ok": true,
"check": "build_workflow_audit_payload",
"pipeline_definition_id": 3847,
"payload_ok": true,
"workflow_name": "SH_PLUS_BQ_RAISE_data_daily_new",
"datamart_count": 31,
"datamart_error_count": 0
}Datamart action tools の一覧確認をします。
export MCP_ENDPOINT="https://<cloud-run-url>/mcp"
export MCP_AUTH_TOKEN="$(gcloud secrets versions access latest --secret=trocco-mcp-auth-token)"
npm run smoke:actionsこの smoke test は get_datamart_job_status の guarded response も確認します。create_datamart_definition や update_datamart_definition の実 write は実行しません。
Inspector / local verification
Inspector で stdio server を確認します。
TROCCO_API_KEY=... npm run build
TROCCO_API_KEY=... npm run inspectorCloud Shell などで Inspector proxy が扱いづらい場合は、MCP SDK client から stdio server を直接呼び出して確認します。
MCP tools
SQL資産棚卸しでは、巨大な build_workflow_audit_payload を展開せず、次の順で小さく取得します。
list_workflow_datamartsget_datamartまたはget_datamarts必要に応じて
analyze_datamart_sqlsearch_keysを使ったGitHub/dbtモデル検索
get_workflow
指定した workflow の構造を取得します。
TROCCO endpoint:
GET /api/pipeline_definitions/{pipeline_definition_id}
Input:
{
"pipeline_definition_id": 3847
}get_datamart
指定した datamart definition をSQL資産棚卸し用の標準形式で取得します。pipeline_definition_id を指定すると、Workflow上の直接上流Datamartも dependencies.workflow_nodes に含めます。include_query: false ではSQL全文を省略し、include_raw: true のときだけTROCCO APIの生レスポンスを含めます。
TROCCO endpoint:
GET /api/datamart_definitions/{datamart_definition_id}
Input:
{
"datamart_definition_id": 12345,
"pipeline_definition_id": 3847,
"include_query": true
}list_workflow_datamarts
Workflowのtask順を保ってDatamart IDと名前だけを軽量取得します。引数省略時は最大50件を返し、limit / offset でページングできます。execution_order はWorkflowの tasks[] における1始まりの位置です。SQL全文は返しません。一部のnodeを解析できない場合も有効な結果は保持し、warnings に対象node付きで記録します。
{
"pipeline_definition_id": 3847,
"limit": 50,
"offset": 0
}get_datamarts
最大5件を小規模batchで取得します。一部失敗時も成功結果は datamarts に残り、失敗は datamart_errors に対象ID付きで返ります。
{
"datamart_definition_ids": [8251, 8269],
"pipeline_definition_id": 3847,
"include_query": false
}analyze_datamart_sql
SQLから source_tables、ctes、特徴的な sql_identifiers、destination候補、write mode候補、優先度付き search_keys を返します。
{
"query": "select * from `project.dataset.source_table`",
"datamart_definition_id": 8251,
"name": "example_datamart",
"destination_fqtn": "project.dataset.example_table"
}build_workflow_audit_payload
指定した workflow と、その配下の BigQuery datamart definition をまとめて取得します。監査コメント生成の入力 payload として使う統合 tool です。
Input:
{
"pipeline_definition_id": 3847
}Output の主な項目:
{
"ok": true,
"pipeline_definition_id": 3847,
"workflow_name": "SH_PLUS_BQ_RAISE_data_daily_new",
"workflow": {},
"datamarts": [
{
"definition_id": 12345,
"name": "example_datamart",
"destination_dataset": "dataset",
"destination_table": "table",
"write_disposition": "append",
"sql_analysis": {},
"resolved_destination": {},
"resolved_write_disposition": {},
"risk_flags": [],
"downstream_references": []
}
],
"datamart_errors": []
}create_datamart_definition
BigQuery datamart definition を作成します。操作系 tool のため、confirm: true と create_reason が必須です。
TROCCO endpoint:
POST /api/datamart_definitions
Input example:
{
"name": "SH_PLUS_AGGREGATION_example",
"description": "example aggregation datamart",
"datamart_bigquery_option": {
"bigquery_connection_id": 345,
"query": "select 1 as id",
"destination_dataset": "dataset_aggregation_tables",
"destination_table": "example_table",
"write_disposition": "truncate",
"partitioning": "time_unit_column",
"partitioning_time": "DAY",
"partitioning_field": "date_jst"
},
"confirm": true,
"create_reason": "Create a new AGGREGATION datamart for the audited SOURCE->AGGREGATION flow."
}run_datamart_job
既存の datamart definition を実行します。操作系 tool のため、confirm: true と run_reason が必須です。
TROCCO endpoint:
POST /api/datamart_jobs
Input example:
{
"datamart_definition_id": 12345,
"confirm": true,
"run_reason": "Validate the new datamart definition after review."
}update_datamart_definition
既存の BigQuery datamart definition の一部設定を更新します。操作系 tool のため、confirm: true と change_reason が必須です。
TROCCO endpoint:
PATCH /api/datamart_definitions/{datamart_definition_id}
Input example:
{
"datamart_definition_id": 12345,
"patch": {
"write_disposition": "truncate",
"partitioning": "time_unit_column",
"partitioning_time": "DAY",
"partitioning_field": "date_jst"
},
"expected_current": {
"write_disposition": "append"
},
"confirm": true,
"change_reason": "Align write mode with the SOURCE->AGGREGATION audit policy."
}Action tool safety
操作系 tool は、監査支援のために限定的に提供します。
confirm: trueがない入力は schema validation で拒否されますcreate_reason/change_reason/run_reasonのいずれかを必須にしますcreate/update の BigQuery option は allowlist された項目のみ受け付けます
update_datamart_definitionはexpected_currentが指定され、現在値と一致しない場合は PATCH を送信しませんworkflow definition と transfer definition の create/update はこの phase では対象外です
追加の運用メモは docs/definition-actions.md を参照してください。
SQL analysis
sql_analysis は SQL コメントを除去したうえで、監査に必要な最低限の候補を抽出します。
from/joinから source table 候補を抽出with ... asから CTE 名を抽出し、source table 候補からCTE参照を除外GitHub検索候補としてDatamart名、destination、source、CTE、SQL identifierを優先度順に生成
create or replace table/insert into/insert <table>/delete from/mergeから destination 候補を抽出delete fromとinsertの組み合わせをdelete_insertとして推定mergeをmergeとして推定destination と source が同じ table の場合に
destination_also_used_as_sourceをtrueにする
高度な SQL lineage parser ではないため、確定値ではなく監査用の候補値として扱います。
Resolved audit fields
resolved_destination は、API metadata と SQL 推定を分けて扱います。
API の
destination_dataset/destination_tableがあればsource = apiAPI destination がなく SQL 内 destination があれば
source = sql_inferredどちらもなければ
source = unknown
resolved_write_disposition は、API の write_disposition を優先しつつ、SQL 推定値も保持します。
API の
write_dispositionがあればsource = apiAPI 値がなく SQL 推定値があれば
source = sql_inferredどちらもなければ
unknown
Risk flags
現在の実装では、次の risk_flags を返します。
missing_api_destination: API metadata に destination がないsql_destination_inferred: SQL から destination を推定したdestination_also_used_as_source: destination と source が同じ table の可能性があるapi_write_disposition_but_sql_destination_unknown: API write_disposition はあるが SQL から destination が取れないwrite_disposition_mismatch: API と SQL 推定の write_disposition が食い違う
Downstream references
downstream_references は、ある datamart の resolved destination が、別 datamart の sql_analysis.source_tables に含まれる場合に返します。workflow dependency と合わせて確認することで、後続参照や依存漏れの監査に使います。
Error payload
MCP tool は失敗時も JSON text として次の形を返します。
{
"ok": false,
"error": {
"code": "auth_error",
"message": "TROCCO API authentication failed. Check TROCCO_API_KEY.",
"status": 401,
"endpoint": "https://trocco.io/api/...",
"detail": {}
}
}Error code:
config_error:TROCCO_API_KEYが未設定auth_error: 401 / 403not_found: 404。workflow または datamart が存在しない、もしくは権限がないapi_error: その他の HTTP errornetwork_error: TROCCO API に接続できない
次の確認ステップ
Cloud Run に最新の branch を deploy する
/statusと/mcpの認証を確認するnpm run smoke:httpを実行するnpm run smoke:actionsを実行するChatGPT に
https://<cloud-run-url>/mcpを追加するChatGPT から
build_workflow_audit_payloadを実行し、監査に進む
Available Tools
2 toolsget_datamartC
Fetch a TROCCO datamart definition by datamart_definition_id, including BigQuery SQL and option metadata when available.
| Name | Required | Description | Default |
|---|---|---|---|
| datamart_definition_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided; the description does not disclose side effects, permissions, rate limits, or error handling. It only notes that SQL and metadata may not always be available ('when available'), which is a minor behavioral detail but insufficient for a complete transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that conveys the core purpose without unnecessary words. It could benefit from a brief note on output but remains efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given only one parameter, no output schema, and no annotations, the description is minimally adequate. It states what is fetched but omits details on return format, error conditions, and integration points. A more complete description would include expected output structure and potential failures.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description should add meaning to the parameter. It only mentions 'by datamart_definition_id', which repeats the parameter name without explaining its format, constraints, or relationship to the tool's behavior. The schema already defines it as integer with exclusiveMinimum, so the description adds no value.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action (Fetch) and resource (TROCCO datamart definition), specifying what is included (BigQuery SQL and option metadata). It distinguishes from the sibling get_workflow implicitly by focusing on datamart, but lacks explicit differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance on when to use this tool versus alternatives, no prerequisites, and no conditions for use. The sibling 'get_workflow' exists but no comparison is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_workflowA
Fetch a TROCCO workflow definition by pipeline_definition_id for read-only audit preparation.
| Name | Required | Description | Default |
|---|---|---|---|
| pipeline_definition_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It states 'read-only,' indicating no side effects, which is a useful behavioral hint. However, it does not disclose other traits such as error handling (e.g., what happens if pipeline_definition_id is missing or invalid), authorization requirements, or idempotency. The description adds some transparency but lacks completeness.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, well-structured sentence of 15 words. It front-loads the verb and resource, and every word is informative. There is no redundancy or filler, making it highly concise and efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema), the description provides the basic purpose and context. However, it omits important details such as the return format, potential errors, or prerequisites. For an AI agent to invoke it correctly, more information about what the response contains would be helpful. The description is too minimal for full completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 0% description coverage, meaning the description does not elaborate on the parameter pipeline_definition_id beyond mentioning it by name. The schema defines it as an integer with exclusiveMinimum 0, but the description adds no additional meaning about its purpose, format, or constraints. With such low coverage, the description should compensate, but it fails to do so.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Fetch a TROCCO workflow definition by pipeline_definition_id for read-only audit preparation.' It specifies the verb (Fetch), the resource (workflow definition), the identifier (pipeline_definition_id), and the context (read-only audit preparation). This distinguishes it from the sibling tool get_datamart, which operates on a different resource.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides context by stating 'for read-only audit preparation,' which implies when to use this tool (audit scenarios). However, it does not explicitly exclude alternative uses or compare against the sibling tool get_datamart. The guidance is clear but not comprehensive enough for a score of 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Both tools target distinct resources (datamart vs workflow) with no overlapping functionality, making them easily distinguishable.
Both tools follow the consistent verb_noun pattern (get_datamart, get_workflow), providing predictability.
Only two tools for a server named 'trocco-mcp-tools' is very limited; likely insufficient for a data platform's typical operations.
Only read operations (get) are provided; missing create, update, delete, and other lifecycle operations, leaving significant gaps.
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 Connectors
Read-only MCP tools for AI agent discovery, structured resources, and NIULAI information.
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read and edit GA4, Search Console and Google Tag Manager from any MCP client. 29 tools.
Read-only MCP server for turva.dev, an agent-readiness audit and advisory service.
Related MCP Servers
- AlicenseAqualityAmaintenanceRead-only MCP tools for authenticated Open Science Framework projects, components, files, and contributors.61Apache 2.0
- FlicenseNot gradedqualityBmaintenanceRead-only MCP tools for querying APISIX routes, upstreams, services, and plugins across environments, without giving direct access to the admin API.
- AlicenseNot gradedqualityAmaintenanceProvides read-only MCP tools for market snapshots, position risk, order reconciliation, and daily report previews with deterministic financial calculations, evidence chains, and audit trails.MIT
- AlicenseNot gradedqualityBmaintenanceProvides read-only MCP tools for TaskMarket, enabling users to list open tasks, inspect task details, and prepare delegation drafts with approval fingerprints.MIT
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/Growth-Management/trocco-mcp-tools'
If you have feedback or need assistance with the MCP directory API, please join our Discord server