BhavikaTibrewal/testhub-mcp-server
3.1
If you are the rightful owner of testhub-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Testhub MCP Server is a context-aware layer that enhances the Testhub API by providing dynamic API context and intelligent tooling.
Testhub MCP Server
An MCP server that gives AI tools rich, up-to-date context about the Testhub API by:
- Loading the Testhub OpenAPI spec at runtime
- Surfacing endpoint details (methods, parameters, request/response schemas)
- Finding and returning Ruby SDK code snippets generated from that spec
This reduces guesswork for developers and aligns with the Testhub → testhub-sdk-ruby → Teststack workflow.
Features
- Dynamic OpenAPI loading from the Testhub repo (no manual sync)
- Tools to list operations and inspect any operation’s details
- Ruby snippet lookup from the generated
testhub-sdk-ruby
(docs/lib)
How it works
src/services/openapiService.js
loadsopenapi.yaml
using js-yaml. It can be pointed via env var or defaults to a siblingtesthub/openapi.yaml
.src/services/rubySdkService.js
searches the generated Ruby SDK for examples:- Looks in
docs/*.md
for code-fenced ruby examples - Falls back to scanning
lib/**/*.rb
for theoperationId
- Looks in
src/tools/registerOpenApiTools.js
registers MCP tools that expose this context.server.js
wires everything and starts an MCP server over stdio.
Available MCP tools
list_testhub_operations
- Description: List operations from Testhub OpenAPI (method, path, operationId, summary)
- Args: none
get_operation_details
- Description: Get OpenAPI details and a Ruby SDK snippet for an operation
- Args (all optional, but at least one way to identify the op is required):
operationId
(string)path
(string, e.g./v1/test-cases/{id}
)method
(string: GET/POST/PUT/DELETE)
The response includes parameters, request/response schemas (application/json), and a ruby example when found.
Environment variables
TESTHUB_OPENAPI_PATH
(optional): Absolute path toopenapi.yaml
. Defaults to<workspace>/testhub/openapi.yaml
.TESTHUB_RUBY_SDK_PATH
(optional): Absolute path to the generatedtesthub-sdk-ruby
. Defaults to<workspace>/testhub-sdk-ruby
.
Notes:
- Ruby snippets are available only after you generate the SDK from the OpenAPI spec:
See ORIGINAL_README.md in
cd testhub-sdk-ruby bash codegen.sh
testhub-sdk-ruby
for details.
Prerequisites
- Node.js 18+
- The Testhub repo available locally (for the OpenAPI file)
- Optionally, the generated
testhub-sdk-ruby
repo for snippet extraction
Install and run
npm install
npm start
On start, the server loads the OpenAPI spec and exposes the tools over MCP stdio.
Troubleshooting
- Spec not found: Set
TESTHUB_OPENAPI_PATH
to the correctopenapi.yaml
. - No ruby snippet: Ensure the Ruby SDK has been generated (
bash codegen.sh
) and setTESTHUB_RUBY_SDK_PATH
if it’s not a sibling folder. - ESM/CommonJS import errors: This project uses ES modules. Use
import
syntax and Node.js 18+.
Security
- No secrets are read from the Testhub repo. Paths are configurable via env vars.
- This server runs locally over stdio and doesn’t bind a network port by default.
Roadmap
- Add tools to validate request bodies against schemas
- Generate ready-to-run curl and Ruby examples per operation
- Surface auth/security schemes from OpenAPI