tm-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| TM_API_KEY | Yes | Full tm_… value provisioned from in-app Settings → API keys | |
| TM_BASE_URL | Yes | URL of your TrafficMorph install (http://localhost:8080 for local dev, your hosted URL otherwise). No built-in default — the server refuses to start without it | |
| TM_MCP_CAPTURE_ROOT | No | Default root for capture file paths. Allow-listed root for tm_analyse_capture + tm_import_capture file paths | ~/.trafficmorph/captures/ |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
| experimental | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| tm_list_profilesA | List all traffic profiles owned by the authenticated user. Returns a list of lightweight summaries — one per profile —
with id, name, and createdAt. Use Ordering: server-default (typically most-recently-updated first). The endpoint doesn't expose a sort parameter. |
| tm_get_profileA | Get the full configuration of a single traffic profile by id. Returns: name, RPS curve points, target URL, HTTP method,
request body / headers, optional init/cleanup/response scripts,
callback config, auto-alert settings, schedule (if any), AND
the current run status ( 400 if the profile isn't found or doesn't belong to this user (per the v1 API contract — IllegalArgumentException → 400). |
| tm_list_historyA | List past runs with optional filters. The killer use case for CI-failure triage: returns the 10 most recent failing runs across all profiles. Filters are AND-combined:
Returns the standard pagination envelope:
|
| tm_get_runA | Get one run's full detail — the CI post-run inspection endpoint. Returns the complete metric set: response-code distribution, latency quantiles (p50/p95/p99/...), RPS / latency time series, secondary stats from response scripts, the auto-comparison snapshot against the configured baseline, AND the auto-verdict
For comparing two runs side-by-side, use |
| tm_compare_runsA | Synthetic side-by-side diff of two runs. No equivalent /api/v1 endpoint exists — this tool fetches both
runs and computes the delta client-side. Note: the response
shape here is the MCP server's own — distinct from the native
Return shape: .. code-block:: python Metrics covered: Regression flag fires only for metrics with a known
"bad direction": Threshold is intentionally generous (10%) — the server's auto-comparison uses tighter thresholds for the official verdict; this tool is a "draw attention to these metrics" surface for the AI to narrate alongside the verdict. Invariants enforced — mirror the native
|
| tm_list_domainsA | List all domains registered by the authenticated user with their verification status. Each entry carries id, domain, verified flag, and the DNS / HTTP challenge tokens that are still in play. Useful for answering "what domains am I allowed to load-test?" and for walking a user through verification. |
| tm_add_domainA | Register a new domain for verification. Returns the
Verification is required before TrafficMorph will run traffic against the domain — it's the gate that prevents arbitrary abuse-as-a-service. Two verification methods are offered; the same token is used for both — pick whichever method is easier to set up:
Response shape:: The Idempotent: calling again with the same domain returns the existing record with the same token (the server treats repeat registrations as no-ops). |
| tm_verify_domain_dnsA | Run the DNS-TXT verification check on a previously-added domain. The server looks up the TXT record at
On miss the server returns 400 (rather than a polling- style 200 "still pending"). That's deliberate — CI flows fail fast on misconfigured DNS instead of looping forever. The 400 error message includes the expected TXT name + token, so the AI host can read it back to the user verbatim for them to copy into their DNS provider. Success response is the same |
| tm_verify_domain_httpA | Run the HTTP-token verification check on a previously-added domain. The server fetches
Alternative to :func: Same fail-fast contract: misses return 400 with the expected URL + token in the message, not a "still pending" 200. The error message is constructed to be readable directly to the user (no JSON parsing required by the AI host). Success response: |
| tm_delete_domainA | Remove a registered domain. Profiles targeting this domain remain saved but won't be
runnable until another verified domain covers the target host
(see :func: Returns |
| tm_list_variables_setsA | List all variables sets owned by the authenticated user. Returns metadata only — id, name, mode, macro columns, optional
weight column, row count, byte size, timestamps. The raw CSV
content is NOT included (it's downloaded via a separate UI-only
endpoint when needed). For a single set's full metadata use
:func: Useful for answering "what variables sets do I have available to attach to a profile?" — common follow-up when the AI is asked to set up a parameterized load test. |
| tm_get_variables_setA | Get a single variables set's metadata. Returns the same shape as one element of :func: |
| tm_create_variables_setA | Create a new variables set from inline CSV content.
The header row's column names define which Attached to a profile whose URL is
Returns the created set's metadata (id, name, mode,
macroColumns, weightColumn, rowCount, byteSize). The AI host
typically follows with attaching the new set to a profile —
that's handled via Quota: each account has a per-user variables-set quota.
A 400 with Duplicate names rejected (strict-uniqueness semantics).
Per-user, names must be unique — a second create call with
a name that already exists 400s with |
| tm_rename_variables_setA | Rename a variables set. Changes only the display name; the CSV content, sampling mode, and attached-profile relationships are untouched. Returns the updated metadata (same shape as :func: |
| tm_change_variables_set_modeA | Switch sampling mode on an existing set without re-uploading
the CSV. Accepts any of the three modes: Common use cases:
The server re-parses the stored CSV with the target mode and
400s if the CSV is incompatible — e.g. switching to
Returns the updated metadata. |
| tm_delete_variables_setA | Delete a variables set. Fails fast (HTTP 400) if the set is still attached to any profile — the server does NOT auto-detach. The server-side error message names the referencing profile(s)
so the caller can detach them first. The MCP layer preserves
that message verbatim in the typed To delete an attached set, the typical recovery is to call
:func: Returns |
| tm_start_runA | Start a traffic run for the given profile. Default behavior ( Set
Return shape: .. code-block:: python Run-correlation defense. Exact Additional defenses kept as belt-and-suspenders:
Fail closed when ambiguous. Row with neither a runId nor a parseable startedAt → ToolError. Better to surface "can't verify identity" than silently return a possibly-wrong verdict. |
| tm_stop_runA | Stop the in-flight run for a profile. Fully idempotent —
succeeds with |
| tm_pause_runA | Pause the in-flight run for a profile. Idempotent — when no
run is active, returns |
| tm_resume_runA | Resume a paused run. Continues from the pre-pause position on the RPS curve and any SEQUENTIAL variables-set cursors. Not idempotent in the no-state case — unlike stop/pause, calling resume without an in-flight or paused run is a 400. |
| tm_analyse_captureA | Analyse a JSONL traffic capture and return the proposed profile structure.
Returns per-endpoint analysis: URL skeleton with |
| tm_import_captureA | Import the chosen groups from an analysed JSONL capture as real traffic profiles. Workflow: call :func:
Each Returns the server's import result: |
| tm_create_profileA | Create a new traffic profile (upsert by Minimum viable profile = Optional shape knobs:
Not yet exposed via MCP: init / response / cleanup scripts, alert policy, callback URL, schedule. Use the web UI or the public REST API directly for those. Name-collision behavior: the server's create endpoint is
upsert-by- Name comparison matches the server's normalization: whitespace
is trimmed and the match is per-character case-insensitive
(mirrors the JDBC ASCII names recommended. Non-ASCII names (e.g. To modify an existing profile, use :func: Concurrency caveat: the collision check is a client-side
preflight against Returns the full saved profile dict (id, name, duration, …). |
| tm_update_profileA | Update an existing profile by id. Fields you omit are kept as-is. The underlying API endpoint is a full PUT (the request body replaces every field of the profile), but exposing that directly would force the AI to GET-then-PUT in two calls for every tweak. This tool does the read-merge-write internally: fetches the current profile, overlays the kwargs you provided, PUTs the merged body back. Use this when you know the profile's id. Examples:
Fields not yet exposed (scripts / alerts / schedule) are preserved verbatim from the existing profile. Rename caveat: the server's PUT endpoint correctly routes
by path id (it pins the request body's profile id to the
path id, so the save path takes its id-based update branch).
But the server does NOT enforce name uniqueness, so a
rename to another profile's name would create a duplicate-
named pair. To keep the data model clean and AI workflows
predictable, this tool still pre-flights a Returns the full updated profile dict. |
| tm_delete_profileA | Delete a profile by id. Any in-flight run is cancelled server-side; run history rows are retained (only the profile definition is removed). Returns |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| tm_triage | Find the most recent FAIL run for a profile, compare against the most recent PASS baseline, and explain what regressed. Returns a narrative the AI can read back to the user. |
| tm_setup_loadtest | Walk through: domain verification (if needed), profile creation with a flat-RPS curve, optional immediate run. Handles the domain-not-verified case gracefully by walking the user through DNS/HTTP setup. |
| tm_compare_baseline | Quick regression check: fetch the most recent run and most recent PASS for a profile, then diff them. Useful between CI runs or after a deploy. |
| tm_import_capture_guided | Analyse a capture file, present the discovered groups in a compact table, ask the user which groups to import as profiles, then commit. Handles the analyse → review → import loop that's otherwise awkward over a single chat turn. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| profiles | Lightweight summary of every traffic profile owned by the authenticated user. Same payload as `tm_list_profiles` — use this resource when you want to ground a conversation in 'what profiles do I have' without an explicit tool call. |
| history_recent | Most-recent 20 traffic runs across all your profiles, newest first. Useful as session-start context for questions like 'what failed recently' or 'show me the last week's traffic'. For filtered / paginated history use the `tm_list_history` tool. |
| domains | All domains registered by the authenticated user, with verification status (verified / pending) and the challenge tokens still in play. Same payload as `tm_list_domains`. Pull this when answering 'what domains am I cleared to load-test' or while diagnosing a domain-not-verified block at run-start. |
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/trafficmorph-gif/tm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server