Skip to content

Commit ba989aa

Browse files
authored
Merge branch 'main' into astra-db
2 parents 7f92b0e + e181222 commit ba989aa

File tree

9 files changed

+190
-32
lines changed

9 files changed

+190
-32
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Official integrations are maintained by companies building production ready MCP
7474
- <img height="12" width="12" src="https://cdn.prod.website-files.com/6605a2979ff17b2cd1939cd4/6605a460de47e7596ed84f06_icon256.png" alt="gotoHuman Logo" /> **[gotoHuman](https://github.com/gotohuman/gotohuman-mcp-server)** - Human-in-the-loop platform - Allow AI agents and automations to send requests for approval to your [gotoHuman](https://www.gotohuman.com) inbox.
7575
- <img height="12" width="12" src="https://grafana.com/favicon.ico" alt="Grafana Logo" /> **[Grafana](https://github.com/grafana/mcp-grafana)** - Search dashboards, investigate incidents and query datasources in your Grafana instance
7676
- <img height="12" width="12" src="https://framerusercontent.com/images/KCOWBYLKunDff1Dr452y6EfjiU.png" alt="Graphlit Logo" /> **[Graphlit](https://github.com/graphlit/graphlit-mcp-server)** - Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a searchable [Graphlit](https://www.graphlit.com) project.
77+
- <img height="12" width="12" src="https://greptime.com/favicon.ico" alt="Greptime Logo" /> **[GreptimeDB](https://github.com/GreptimeTeam/greptimedb-mcp-server)** - Provides AI assistants with a secure and structured way to explore and analyze data in [GreptimeDB](https://github.com/GreptimeTeam/greptimedb).
7778
- <img height="12" width="12" src="https://img.alicdn.com/imgextra/i3/O1CN01d9qrry1i6lTNa2BRa_!!6000000004364-2-tps-218-200.png" alt="Hologres Logo" /> **[Hologres](https://github.com/aliyun/alibabacloud-hologres-mcp-server)** - Connect to a [Hologres](https://www.alibabacloud.com/en/product/hologres) instance, get table metadata, query and analyze data.
7879
- <img height="12" width="12" src="https://hyperbrowser-assets-bucket.s3.us-east-1.amazonaws.com/Hyperbrowser-logo.png" alt="Hyperbrowsers23 Logo" /> **[Hyperbrowser](https://github.com/hyperbrowserai/mcp)** - [Hyperbrowser](https://www.hyperbrowser.ai/) is the next-generation platform empowering AI agents and enabling effortless, scalable browser automation.
7980
- **[IBM wxflows](https://github.com/IBM/wxflows/tree/main/examples/mcp/javascript)** - Tool platform by IBM to build, test and deploy tools for any data source

src/fetch/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotoc
107107

108108
This can be customized by adding the argument `--user-agent=YourUserAgent` to the `args` list in the configuration.
109109

110+
### Customization - Proxy
111+
112+
The server can be configured to use a proxy by using the `--proxy-url` argument.
113+
110114
## Debugging
111115

112116
You can use the MCP inspector to debug the server. For uvx installations:

src/fetch/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "mcp-server-fetch"
3-
version = "0.6.2"
3+
version = "0.6.3"
44
description = "A Model Context Protocol server providing tools to fetch and convert web content for usage by LLMs"
55
readme = "README.md"
66
requires-python = ">=3.10"
@@ -16,6 +16,7 @@ classifiers = [
1616
"Programming Language :: Python :: 3.10",
1717
]
1818
dependencies = [
19+
"httpx<0.28",
1920
"markdownify>=0.13.1",
2021
"mcp>=1.1.3",
2122
"protego>=0.3.1",

src/fetch/src/mcp_server_fetch/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ def main():
1515
action="store_true",
1616
help="Ignore robots.txt restrictions",
1717
)
18+
parser.add_argument("--proxy-url", type=str, help="Proxy URL to use for requests")
1819

1920
args = parser.parse_args()
20-
asyncio.run(serve(args.user_agent, args.ignore_robots_txt))
21+
asyncio.run(serve(args.user_agent, args.ignore_robots_txt, args.proxy_url))
2122

2223

2324
if __name__ == "__main__":

src/fetch/src/mcp_server_fetch/server.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def get_robots_txt_url(url: str) -> str:
6363
return robots_url
6464

6565

66-
async def check_may_autonomously_fetch_url(url: str, user_agent: str) -> None:
66+
async def check_may_autonomously_fetch_url(url: str, user_agent: str, proxy_url: str | None = None) -> None:
6767
"""
6868
Check if the URL can be fetched by the user agent according to the robots.txt file.
6969
Raises a McpError if not.
@@ -72,7 +72,7 @@ async def check_may_autonomously_fetch_url(url: str, user_agent: str) -> None:
7272

7373
robot_txt_url = get_robots_txt_url(url)
7474

75-
async with AsyncClient() as client:
75+
async with AsyncClient(proxies=proxy_url) as client:
7676
try:
7777
response = await client.get(
7878
robot_txt_url,
@@ -109,14 +109,14 @@ async def check_may_autonomously_fetch_url(url: str, user_agent: str) -> None:
109109

110110

111111
async def fetch_url(
112-
url: str, user_agent: str, force_raw: bool = False
112+
url: str, user_agent: str, force_raw: bool = False, proxy_url: str | None = None
113113
) -> Tuple[str, str]:
114114
"""
115115
Fetch the URL and return the content in a form ready for the LLM, as well as a prefix string with status information.
116116
"""
117117
from httpx import AsyncClient, HTTPError
118118

119-
async with AsyncClient() as client:
119+
async with AsyncClient(proxies=proxy_url) as client:
120120
try:
121121
response = await client.get(
122122
url,
@@ -173,19 +173,22 @@ class Fetch(BaseModel):
173173
bool,
174174
Field(
175175
default=False,
176-
description="Get the actual HTML content if the requested page, without simplification.",
176+
description="Get the actual HTML content of the requested page, without simplification.",
177177
),
178178
]
179179

180180

181181
async def serve(
182-
custom_user_agent: str | None = None, ignore_robots_txt: bool = False
182+
custom_user_agent: str | None = None,
183+
ignore_robots_txt: bool = False,
184+
proxy_url: str | None = None,
183185
) -> None:
184186
"""Run the fetch MCP server.
185187
186188
Args:
187189
custom_user_agent: Optional custom User-Agent string to use for requests
188190
ignore_robots_txt: Whether to ignore robots.txt restrictions
191+
proxy_url: Optional proxy URL to use for requests
189192
"""
190193
server = Server("mcp-fetch")
191194
user_agent_autonomous = custom_user_agent or DEFAULT_USER_AGENT_AUTONOMOUS
@@ -229,10 +232,10 @@ async def call_tool(name, arguments: dict) -> list[TextContent]:
229232
raise McpError(ErrorData(code=INVALID_PARAMS, message="URL is required"))
230233

231234
if not ignore_robots_txt:
232-
await check_may_autonomously_fetch_url(url, user_agent_autonomous)
235+
await check_may_autonomously_fetch_url(url, user_agent_autonomous, proxy_url)
233236

234237
content, prefix = await fetch_url(
235-
url, user_agent_autonomous, force_raw=args.raw
238+
url, user_agent_autonomous, force_raw=args.raw, proxy_url=proxy_url
236239
)
237240
original_length = len(content)
238241
if args.start_index >= original_length:
@@ -259,7 +262,7 @@ async def get_prompt(name: str, arguments: dict | None) -> GetPromptResult:
259262
url = arguments["url"]
260263

261264
try:
262-
content, prefix = await fetch_url(url, user_agent_manual)
265+
content, prefix = await fetch_url(url, user_agent_manual, proxy_url=proxy_url)
263266
# TODO: after SDK bug is addressed, don't catch the exception
264267
except McpError as e:
265268
return GetPromptResult(

src/github/index.ts

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
} from "@modelcontextprotocol/sdk/types.js";
88
import { z } from 'zod';
99
import { zodToJsonSchema } from 'zod-to-json-schema';
10+
import fetch, { Request, Response } from 'node-fetch';
1011

1112
import * as repository from './operations/repository.js';
1213
import * as files from './operations/files.js';
@@ -27,6 +28,11 @@ import {
2728
} from './common/errors.js';
2829
import { VERSION } from "./common/version.js";
2930

31+
// If fetch doesn't exist in global scope, add it
32+
if (!globalThis.fetch) {
33+
globalThis.fetch = fetch as unknown as typeof global.fetch;
34+
}
35+
3036
const server = new Server(
3137
{
3238
name: "github-mcp-server",
@@ -293,10 +299,39 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
293299
case "create_issue": {
294300
const args = issues.CreateIssueSchema.parse(request.params.arguments);
295301
const { owner, repo, ...options } = args;
296-
const issue = await issues.createIssue(owner, repo, options);
297-
return {
298-
content: [{ type: "text", text: JSON.stringify(issue, null, 2) }],
299-
};
302+
303+
try {
304+
console.error(`[DEBUG] Attempting to create issue in ${owner}/${repo}`);
305+
console.error(`[DEBUG] Issue options:`, JSON.stringify(options, null, 2));
306+
307+
const issue = await issues.createIssue(owner, repo, options);
308+
309+
console.error(`[DEBUG] Issue created successfully`);
310+
return {
311+
content: [{ type: "text", text: JSON.stringify(issue, null, 2) }],
312+
};
313+
} catch (err) {
314+
// Type guard for Error objects
315+
const error = err instanceof Error ? err : new Error(String(err));
316+
317+
console.error(`[ERROR] Failed to create issue:`, error);
318+
319+
if (error instanceof GitHubResourceNotFoundError) {
320+
throw new Error(
321+
`Repository '${owner}/${repo}' not found. Please verify:\n` +
322+
`1. The repository exists\n` +
323+
`2. You have correct access permissions\n` +
324+
`3. The owner and repository names are spelled correctly`
325+
);
326+
}
327+
328+
// Safely access error properties
329+
throw new Error(
330+
`Failed to create issue: ${error.message}${
331+
error.stack ? `\nStack: ${error.stack}` : ''
332+
}`
333+
);
334+
}
300335
}
301336

302337
case "create_pull_request": {

src/gitlab/schemas.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ export const GitLabRepositorySchema = z.object({
2222
name: z.string(),
2323
path_with_namespace: z.string(), // Changed from full_name to match GitLab API
2424
visibility: z.string(), // Changed from private to match GitLab API
25-
owner: GitLabOwnerSchema,
25+
owner: GitLabOwnerSchema.optional(),
2626
web_url: z.string(), // Changed from html_url to match GitLab API
2727
description: z.string().nullable(),
28-
fork: z.boolean(),
28+
fork: z.boolean().optional(),
2929
ssh_url_to_repo: z.string(), // Changed from ssh_url to match GitLab API
3030
http_url_to_repo: z.string(), // Changed from clone_url to match GitLab API
3131
created_at: z.string(),
@@ -218,12 +218,12 @@ export const GitLabMergeRequestSchema = z.object({
218218
title: z.string(),
219219
description: z.string(), // Changed from body to match GitLab API
220220
state: z.string(),
221-
merged: z.boolean(),
221+
merged: z.boolean().optional(),
222222
author: GitLabUserSchema,
223223
assignees: z.array(GitLabUserSchema),
224224
source_branch: z.string(), // Changed from head to match GitLab API
225225
target_branch: z.string(), // Changed from base to match GitLab API
226-
diff_refs: GitLabMergeRequestDiffRefSchema,
226+
diff_refs: GitLabMergeRequestDiffRefSchema.nullable(),
227227
web_url: z.string(), // Changed from html_url to match GitLab API
228228
created_at: z.string(),
229229
updated_at: z.string(),

src/puppeteer/README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ A Model Context Protocol server that provides browser automation capabilities us
88

99
- **puppeteer_navigate**
1010
- Navigate to any URL in the browser
11-
- Input: `url` (string)
11+
- Inputs:
12+
- `url` (string, required): URL to navigate to
13+
- `launchOptions` (object, optional): PuppeteerJS LaunchOptions. Default null. If changed and not null, browser restarts. Example: `{ headless: true, args: ['--user-data-dir="C:/Data"'] }`
14+
- `allowDangerous` (boolean, optional): Allow dangerous LaunchOptions that reduce security. When false, dangerous args like `--no-sandbox`, `--disable-web-security` will throw errors. Default false.
1215

1316
- **puppeteer_screenshot**
1417
- Capture screenshots of the entire page or specific elements
@@ -61,6 +64,7 @@ The server provides access to two types of resources:
6164
- Screenshot capabilities
6265
- JavaScript execution
6366
- Basic web interaction (navigation, clicking, form filling)
67+
- Customizable Puppeteer launch options
6468

6569
## Configuration to use Puppeteer Server
6670
Here's the Claude Desktop configuration to use the Puppeter server:
@@ -93,6 +97,39 @@ Here's the Claude Desktop configuration to use the Puppeter server:
9397
}
9498
```
9599

100+
### Launch Options
101+
102+
You can customize Puppeteer's browser behavior in two ways:
103+
104+
1. **Environment Variable**: Set `PUPPETEER_LAUNCH_OPTIONS` with a JSON-encoded string in the MCP configuration's `env` parameter:
105+
106+
```json
107+
{
108+
"mcpServers": {
109+
"mcp-puppeteer": {
110+
"command": "npx",
111+
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
112+
"env": {
113+
"PUPPETEER_LAUNCH_OPTIONS": "{ \"headless\": false, \"executablePath\": \"C:/Program Files/Google/Chrome/Application/chrome.exe\", \"args\": [] }",
114+
"ALLOW_DANGEROUS": "true"
115+
}
116+
}
117+
}
118+
}
119+
```
120+
121+
2. **Tool Call Arguments**: Pass `launchOptions` and `allowDangerous` parameters to the `puppeteer_navigate` tool:
122+
123+
```json
124+
{
125+
"url": "https://example.com",
126+
"launchOptions": {
127+
"headless": false,
128+
"defaultViewport": {"width": 1280, "height": 720}
129+
}
130+
}
131+
```
132+
96133
## Build
97134

98135
Docker build:
@@ -103,4 +140,4 @@ docker build -t mcp/puppeteer -f src/puppeteer/Dockerfile .
103140

104141
## License
105142

106-
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
143+
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

0 commit comments

Comments
 (0)