Skip to content

Commit 0ada24c

Browse files
authored
feat(tavily- mcp-server): Implementation
1 parent 7d7d31f commit 0ada24c

16 files changed

+8244
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"actorSpecification": 1,
3+
"name": "tavily-mcp-server",
4+
"title": "Tavily MCP Server",
5+
"description": "Advanced web search and data extraction capabilities through the Tavily API, providing real-time web search, intelligent data extraction, website mapping, and web crawling tools.",
6+
"version": "0.0",
7+
"buildTag": "latest",
8+
"usesStandbyMode": true,
9+
"meta": {
10+
"templateId": "ts-mcp-server"
11+
},
12+
"input": {
13+
"title": "Actor input schema",
14+
"description": "This is Actor input schema",
15+
"type": "object",
16+
"schemaVersion": 1,
17+
"properties": {},
18+
"required": []
19+
},
20+
"dockerfile": "../Dockerfile",
21+
"webServerMcpPath": "/mcp"
22+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"actor-start": {
3+
"eventTitle": "Price for Actor start",
4+
"eventDescription": "Flat fee for starting an Actor run.",
5+
"eventPriceUsd": 0.1
6+
},
7+
"tavily-search": {
8+
"eventTitle": "Price for Tavily search request",
9+
"eventDescription": "Fee for performing a web search using Tavily API.",
10+
"eventPriceUsd": 0.10
11+
},
12+
"tavily-extract": {
13+
"eventTitle": "Price for Tavily extract request",
14+
"eventDescription": "Fee for extracting content from web pages using Tavily API.",
15+
"eventPriceUsd": 0.08
16+
},
17+
"tavily-map": {
18+
"eventTitle": "Price for Tavily map request",
19+
"eventDescription": "Fee for mapping website structure using Tavily API.",
20+
"eventPriceUsd": 0.15
21+
},
22+
"tavily-crawl": {
23+
"eventTitle": "Price for Tavily crawl request",
24+
"eventDescription": "Price for Tavily crawl request",
25+
"eventPriceUsd": 0.20
26+
}
27+
}

tavily-mcp-server/.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 4
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
end_of_line = lf

tavily-mcp-server/.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file tells Git which files shouldn't be added to source control
2+
3+
.idea
4+
.vscode
5+
.zed
6+
storage
7+
apify_storage
8+
crawlee_storage
9+
node_modules
10+
dist
11+
tsconfig.tsbuildinfo
12+
13+
# Added by Apify CLI
14+
.venv

tavily-mcp-server/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.prettierignore

tavily-mcp-server/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"printWidth": 120,
3+
"singleQuote": true,
4+
"tabWidth": 4
5+
}

tavily-mcp-server/Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Specify the base Docker image. You can read more about
2+
# the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
3+
# You can also use any other image from Docker Hub.
4+
FROM apify/actor-node:22 AS builder
5+
6+
# Check preinstalled packages
7+
RUN npm ls crawlee apify puppeteer playwright
8+
9+
# Copy just package.json and package-lock.json
10+
# to speed up the build using Docker layer cache.
11+
COPY package*.json ./
12+
13+
# Install all dependencies. Don't audit to speed up the installation.
14+
RUN npm install --include=dev --audit=false
15+
16+
# Next, copy the source files using the user set
17+
# in the base image.
18+
COPY . ./
19+
20+
# Install all dependencies and build the project.
21+
# Don't audit to speed up the installation.
22+
RUN npm run build
23+
24+
# Create final image
25+
FROM apify/actor-node:22
26+
27+
# Check preinstalled packages
28+
RUN npm ls crawlee apify puppeteer playwright
29+
30+
# Copy just package.json and package-lock.json
31+
# to speed up the build using Docker layer cache.
32+
COPY package*.json ./
33+
34+
# Install NPM packages, skip optional and development dependencies to
35+
# keep the image small. Avoid logging too much and print the dependency
36+
# tree for debugging
37+
RUN npm --quiet set progress=false \
38+
&& npm install --omit=dev --omit=optional \
39+
&& echo "Installed NPM packages:" \
40+
&& (npm list --omit=dev --all || true) \
41+
&& echo "Node.js version:" \
42+
&& node --version \
43+
&& echo "NPM version:" \
44+
&& npm --version \
45+
&& rm -r ~/.npm
46+
47+
# Copy built JS files from builder image
48+
COPY --from=builder /usr/src/app/dist ./dist
49+
50+
# Next, copy the remaining files and directories with the source code.
51+
# Since we do this after NPM install, quick build will be really fast
52+
# for most source file changes.
53+
COPY . ./
54+
55+
# Run the image.
56+
CMD npm run start:prod --silent

tavily-mcp-server/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## Tavily MCP Server
2+
3+
Advanced web search and data extraction capabilities through the Tavily API, providing real-time web search, intelligent data extraction, website mapping, and web crawling tools.
4+
5+
**About this MCP Server:** To understand how to connect to and utilize this MCP server, please refer to the official Model Context Protocol documentation at [mcp.apify.com](https://mcp.apify.com).
6+
7+
## Connection URL
8+
MCP clients can connect to this server at:
9+
10+
```text
11+
https://mcp-servers--tavily-mcp-server.apify.actor/mcp
12+
```
13+
14+
## Client Configuration
15+
To connect to this MCP server, use the following configuration in your MCP client:
16+
17+
```json
18+
{
19+
"mcpServers": {
20+
"tavily": {
21+
"url": "https://mcp-servers--tavily-mcp-server.apify.actor/mcp",
22+
"headers": {
23+
"Authorization": "Bearer YOUR_APIFY_TOKEN"
24+
}
25+
}
26+
}
27+
}
28+
```
29+
30+
**Note:** Replace `YOUR_APIFY_TOKEN` with your actual Apify API token. You can find your token in the [Apify Console](https://console.apify.com/account/integrations).
31+
32+
## 🚩 Claim this MCP server
33+
All credits to the original authors of https://github.com/tavily-ai/tavily-mcp
34+
To claim this server, please write to [[email protected]](mailto:[email protected]).
35+
36+
---
37+
38+
# ![Tavily Crawl Beta](https://github.com/tavily-ai/tavily-mcp/raw/main/assets/Banner_NEW.png)
39+
40+
The Tavily MCP server provides:
41+
- **search** - Real-time web search capabilities through the tavily-search tool
42+
- **extract** - Intelligent data extraction from web pages via the tavily-extract tool
43+
- **map** - Powerful web mapping tool that creates a structured map of website
44+
- **crawl** - Web crawler that systematically explores websites
45+
46+
## Available Tools
47+
48+
### tavily-search
49+
Perform real-time web searches using Tavily's advanced search API. This tool can search the web for current information and return relevant, summarized results.
50+
51+
**Parameters:**
52+
- `query` (string, required): The search query
53+
- `search_depth` (string, optional): "basic" or "advanced" search depth
54+
- `max_results` (number, optional): Maximum number of results to return
55+
- `include_domains` (array, optional): List of domains to include in search
56+
- `exclude_domains` (array, optional): List of domains to exclude from search
57+
58+
### tavily-extract
59+
Extract and analyze content from web pages using Tavily's intelligent extraction capabilities.
60+
61+
**Parameters:**
62+
- `urls` (array, required): List of URLs to extract content from
63+
- `content_type` (string, optional): Type of content to extract
64+
65+
### tavily-map
66+
Create a structured map of a website, showing its hierarchy and organization.
67+
68+
**Parameters:**
69+
- `url` (string, required): The website URL to map
70+
- `depth` (number, optional): How deep to crawl the website
71+
72+
### tavily-crawl
73+
Systematically explore and crawl websites to gather comprehensive information.
74+
75+
**Parameters:**
76+
- `url` (string, required): The starting URL for crawling
77+
- `max_pages` (number, optional): Maximum number of pages to crawl
78+
- `depth` (number, optional): Maximum crawl depth
79+
80+
## Configuration
81+
82+
To use this MCP server, you'll need a Tavily API key. You can obtain one from [tavily.com](https://www.tavily.com/).
83+
84+
The server requires the following environment variable:
85+
- `TAVILY_API_KEY`: Your Tavily API key
86+
87+
## References
88+
To learn more about Apify and Actors, take a look at the following resources:
89+
- [Apify SDK for JavaScript documentation](https://docs.apify.com/sdk/js)
90+
- [Apify SDK for Python documentation](https://docs.apify.com/sdk/python)
91+
- [Apify Platform documentation](https://docs.apify.com/platform)
92+
- [Apify MCP Server](https://docs.apify.com/platform/integrations/mcp)
93+
- [Webinar: Building and Monetizing MCP Servers on Apify](https://www.youtube.com/watch?v=w3AH3jIrXXo)
94+
- [Join our developer community on Discord](https://discord.com/invite/jyEM2PRvMU)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import prettier from 'eslint-config-prettier';
2+
3+
import apify from '@apify/eslint-config/ts.js';
4+
import globals from 'globals';
5+
import tsEslint from 'typescript-eslint';
6+
7+
// eslint-disable-next-line import/no-default-export
8+
export default [
9+
{ ignores: ['**/dist', 'eslint.config.mjs'] },
10+
...apify,
11+
prettier,
12+
{
13+
languageOptions: {
14+
parser: tsEslint.parser,
15+
parserOptions: {
16+
project: 'tsconfig.json',
17+
},
18+
globals: {
19+
...globals.node,
20+
...globals.jest,
21+
},
22+
},
23+
plugins: {
24+
'@typescript-eslint': tsEslint.plugin,
25+
},
26+
rules: {
27+
'no-console': 0,
28+
},
29+
},
30+
];

0 commit comments

Comments
 (0)