IDE Agent

Use the TestFlowKit MCP server to generate tests with Cursor or VS Code Copilot

IDE Agent (Cursor / VS Code)

The @testflowkit/mcp server connects your IDE to the step catalog and project config, so AI-generated tests use only registered sentences.

Setup

1. Initialize the project:

tkit init

2. Add MCP config:

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "testflowkit": {
      "command": "npx",
      "args": ["-y", "@testflowkit/mcp"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "testflowkit": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@testflowkit/mcp"]
    }
  }
}

3. Prompt the agent:

"Write a test for user registration using the available API operations."

The agent reads the step catalog and testflowkit.yml, then drafts scenarios with valid steps only.

Requirements

  • tkit CLI installed (for catalog version detection)
  • Node.js >= 22
  • testflowkit.yml in the project root

MCP tools

ToolPurpose
get_step_catalogFull sentence list
search_sentencesFilter by keyword/category
read_test_configAPIs, pages, elements (secrets redacted)
list_features / read_featureBrowse feature files
write_feature / write_macroCreate or update .feature files
get_guidelinesMacro and agent authoring docs

Agent config in testflowkit.yml

agent:
  default_tags_for_draft: "@wip @ai-generated"
  run_command: "tkit run --tags @wip"

The agent: block is ignored by tkit run — only the MCP server reads it.

Missing sentences

If no registered step matches your intent, the agent reports a missing_sentence block instead of inventing one. Use these to request new steps via GitHub issues.

Troubleshooting

ProblemFix
MCP won't startRun npx @testflowkit/mcp manually; check Node >= 22
Catalog emptyVerify tkit version works
Wrong steps usedAsk the agent to call get_step_catalog first

Next Steps