
# Building a serverless competitive intelligence platform with MCP + Task API
Build a competitive intelligence platform with the Parallel Task API configured with Reddit MCP tool calls.

We built a full-stack competitive intelligence platform by combining data from Reddit and the public web.
View the complete app here[here]($https://competitive-analysis-demo.parallel.ai/).
## **Overview**
The app we built allows users to:
- - Authenticate
- - Enter a company domain
- - Kickoff a single Parallel ultra8x Task configured with Reddit MCP tool calls. The complete Task API call is available here[here]($https://platform.parallel.ai/play?view=outputs&id=tspec_b9b024bc538649ceb3392a9ce13bc83a).
- - Receive a detailed, shareable competitive analysis including Reddit sentiment, market research, investment history, feature parity and more
- - Recursively kick off additional analyses on competitors found
- - Access results in the UI or via a Competitive Analysis MCP Server with competitive analysis in a token-dense markdown format
Technology stack:
- - Parallel Task API[Task API]($https://docs.parallel.ai/task-api/task-quickstart) (a single Ultra8x call for each market research report)
- - Reddit MCP via Task API Tool Call[Tool Call]($https://docs.parallel.ai/features/mcp-tool-call)
- - Cloudflare Workers[Workers]($https://workers.cloudflare.com/) for compute and Durable Objects[Durable Objects]($https://developers.cloudflare.com/durable-objects/) for persistence
Get started in 5 minutes:
- - Set up prerequisites:
- - Cloudflare account[Cloudflare account]($https://cloudflare.com) (free tier works)
- - Wrangler CLI[Wrangler CLI]($https://developers.cloudflare.com/workers/wrangler/install-and-update/)
- - Parallel API Key (create here[here]($https://platform.parallel.ai))
- - Clone this repository
- - Update wrangler.json configuration
Or remove the `routes` section entirely to use the default `*.workers.dev` domain.
- - Set environment variables
- - Deploy:
Note: The Task API Spec is defined in `public/task.schema.json` - modify this to change what data gets analyzed based on your use case.
## **Why this architecture**
**Single Task API call vs web research pipeline**
Using the Task API provides the benefits of simplicity, quality and cost-effectiveness vs a typical web research pipeline. The Task API has been benchmarked[benchmarked]($https://parallel.ai/blog/deep-research-benchmarks) against other providers to provide the best-in-class quality at each price point. It also handles the end-to-end web research pipeline, removing the need to build a pipeline that includes reasoning, search, retrieval, ranking, compression and MCP tool call configuration.
The Ultra8x processor was chosen out of each of the Task API processor[processor]($https://docs.parallel.ai/task-api/core-concepts/choose-a-processor) options because the user experience is designed for async research, allowing for slower-running, more in-depth research. The Ultra8x processor can also handle 25 output fields, allowing for several questions to be answered about each company – covering Reddit sentiment, investment history, feature parity, competitor mapping and more in a single API call. This removes the need for piecing together several outputs into a final format.
**Reddit MCP as a competitive research tool**
Reddit has long been considered a valuable resource for individuals to receive unfiltered reviews and advice on various products and companies. The Reddit sentiment surrounding a company is often a strong indicator of the sentiment in their broader user base. It is also an indicator of market presence and mindshare. This makes Reddit a great tool for competitive analysis. Combining comprehensive Reddit analysis with deep web research is unique and valuable for competitive insights.
**Publicly available results**
The system acts as both MCP client and server; external AI systems can consume our competitive analysis while we consume specialized analysis services. This can be very powerful as an agentic research tool; all the research done by Parallel across companies can be included as context for any further analysis.
In this application, we also implement a pipeline that combines company and competitor analyses into a single token-dense markdown context of approximately 15K tokens. This is a careful context engineering design that helps LLMs effectively interpret context from each analysis; each report is also available as a machine-friendly .md file using this approach.
**Serverless edge deployment**
Cloudflare Workers eliminate cold starts and provide global distribution. Analysis results cache at edge locations worldwide, making subsequent requests for the same company's intelligence load instantly regardless of geographic location.
**Webhooks for asynchronous processing**
Complex analysis tasks run asynchronously with webhook callbacks, preventing timeout issues while allowing users to track progress. The webhook pattern scales better than long-polling or WebSocket approaches for sporadic, compute-intensive tasks. Ultra8x Tasks are long-running, so the application prompts users to return after 30 minutes, with the webhook implementation ensuring that completion is efficiently listened for, even if the user closes the page.
**Plain HTML and JS as a frontend language**
This choice helps us reduce complexity by removing the framework to HTML+JS+CSS build-step. It incentivizes the developer to reduce the amount of complex interactions because they’re harder to make in plain HTML and JS. It also simplifies server-side rendering, resulting in highly accessible and performant dynamically generated HTML pages from our data.
This increases accessibility for both humans and machines (such as browser-agents) as complex interactions may be harder to read programmatically which could hide crucial information to AI.
## **Implementation**
### **Dependencies and environment setup**
Dependencies remain minimal by leveraging platform capabilities:
- - **Queryable-object **allows an admin-ui for the Durable Object database
- - **SimplerAuth** provides one line OAuth integration with X without secret management
- - **with-mcp **handles the MCP protocol without custom implementation
- - **Parallel AI SDK** abstracts task orchestration and webhook management
Environment configuration focuses on service endpoints and authentication tokens rather than complex service credentials:
### **Defining the data schema with Queryable**
The analysis data structure captures both immediate analysis results and metadata for search and discovery:
The 14-day refresh policy balances data freshness with processing costs. The search functionality indexes specific fields that contain the most relevant information for discovery queries.
### **Designing the structured enrichment Task via Ultra8x**
An effective competitive analysis requires a carefully written Task Spec which aims to capture all the information required. In the Task Spec, we follow the general Task Spec guidelines:
- - Declarative description fields
- - Majority flat output schema
- - Approximately 25 output fields in total
- - We construct the output fields so that they are mutually exclusive – each finding a key piece of information that we can display in the final report
Importantly, we also include a company_fits_criteria output field which serves as a secondary verification on the company domain, ensuring that the company is legitimate and can have a comprehensive competitive analysis done on it.
The complete Task can be found here[here]($https://platform.parallel.ai/play?view=outputs&id=tspec_b9b024bc538649ceb3392a9ce13bc83a). Next, the Reddit MCP server is added to the Task Spec itself as a tool, using the Tool Calling feature in the Parallel Task API:
### **Handling Webhook results and competitor discovery**
Webhook processing updates analysis results and triggers recursive competitor analysis. First, Webhook signature verification:
Add competitor discovery logic:
Data extraction and storage:
### **Deploying MCP Server capabilities**
The worker exposes analysis tools through MCP protocol integration:
The MCP integration happens at the worker level, wrapping the entire application. This allows external AI systems to discover and call available tools while preserving normal HTTP functionality for web users.
### **Authentication strategy implementation**
Authentication applies selectively based on endpoint and functionality:
MCP endpoints (/md/) remain public to enable AI agent access without complex authentication flows. This design choice prioritizes AI system interoperability over access control.
## **Resources**
- - Full Source Code[Full Source Code]($https://github.com/parallel-web/competitive-analysis-demo)
- - Deployed App[Deployed App]($https://competitive-analysis-demo.parallel.ai/)
- - Parallel MCP Tool Calling Documentation[Tool Calling Documentation]($https://docs.parallel.ai/features/mcp-tool-call)
By Parallel
September 12, 2025





























