How to Install and Use TestSprite MCP for AI-Powered Testing
Learn step-by-step how to set up the TestSprite MCP server, integrate it with your IDE, and leverage AI-driven testing in your projects.
How to Install and Use TestSprite MCP for AI-Powered Testing
Coding Assistant
Overview
TestSprite MCP (Model Context Protocol) turns your IDE’s AI assistant into an autonomous testing agent. It can automatically generate PRDs, test plans, and test code, and run tests securely in the TestSprite cloud.
“One‑command testing makes it feel like the IDE is doing the work for you.” – TestSprite documentation
Prerequisites
- Node.js (v14 or higher)
- Access to your IDE’s MCP configuration (e.g., Cursor, VS Code)
Step 1: Install the MCP Server Globally
1npm install -g @testsprite/testsprite-mcp@latestVerify the installation:
1npm list -g @testsprite/testsprite-mcpYou should see something like @testsprite/testsprite-mcp@0.0.29.
Step 2: Run the Server (Quick Test)
1npx @testsprite/testsprite-mcp@latestIf the server starts without errors, you’re ready to connect it to your IDE.
Step 3: Add the MCP Server to Your IDE
Cursor
- Open Settings → Features → MCP.
- Click “+ Add New MCP Server”.
- In the Command field, enter:
1node $(npm root -g)/@testsprite/testsprite-mcp/build/index.js- Save the configuration. The server will appear in the MCP servers list.
VS Code (example)
Add the following to your settings.json:
1{
2 "mcp.servers": [
3 {
4 "name": "TestSprite MCP",
5 "command": "node $(npm root -g)/@testsprite/testsprite-mcp/build/index.js"
6 }
7 ]
8}Note: Adjust the path if you installed the package locally.
Step 4: Use One‑Command Testing
In your IDE’s chat or Composer window, type:
1Help me test this project with TestSpriteThe AI assistant will:
- Generate a PRD document.
- Create a test plan.
- Write test code.
- Execute the tests in the TestSprite cloud.
Advanced Configuration
| Feature | stdio Server Example | SSE Server Example |
|---|---|---|
| Command | node ~/mcp-quickstart/weather-server-typescript/build/index.js | node server-sse.js |
| Use Case | Simple request/response | Real‑time streaming responses |
| Recommended For | Basic testing workflows | Complex, interactive debugging |
Troubleshooting
- MCP Server Not Connecting – Run
npm list -g @testsprite/testsprite-mcpto confirm the version. - Port Conflicts – Ensure no other service is using the default MCP port (usually 4000). Change the port via the
--portflag:
1@testsprite/testsprite-mcp --port 5000Further Reading
- Official npm package: @testsprite/testsprite-mcp
- Installation guide: TestSprite MCP Docs
- MCP overview in Cursor: Cursor Directory
- Solution page: AI Testing Agent & Automation Platform
By following these steps, you can empower your IDE’s AI assistant to automatically test, debug, and fix your code with a single command. Happy testing!