Skip to content

Commit a21aef6

Browse files
authored
Merge pull request #314 from cwapi3d/feature/mcp-gemini
Feature/mcp gemini + schema for explaining mcp advantage
2 parents d37fcb0 + d36eeca commit a21aef6

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.gif filter=lfs diff=lfs merge=lfs -text

docs/img/console.gif

-415 KB
Loading

docs/img/mcp/gemini-mcp.gif

Lines changed: 3 additions & 0 deletions
Loading
171 KB
Loading

docs/mcp.md

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,49 @@ hide:
1010

1111
## What is MCP?
1212

13-
The **Model Context Protocol (MCP)** is an open standard that enables AI assistants to securely connect to external context. Think of it as a bridge that allows AI models to access real-time, specialized information beyond their training data.
13+
The **Model Context Protocol (MCP)** is an open standard that enables AI assistants to securely connect to external
14+
context. Think of it as a bridge that allows AI models to access real-time, specialized information beyond their
15+
training data.
1416

15-
When you connect an AI assistant to an MCP server, it gains the ability to query that server for relevant context, making responses more accurate and up-to-date.
17+
When you connect an AI assistant to an MCP server, it gains the ability to query that server for relevant context,
18+
making responses more accurate and up-to-date.
1619

17-
## How MCP helps you learn and use the Cadwork Python API
20+
![Screenshot](img/mcp/mcp_python_api_v1.drawio.png){width="1200" style="display: block; margin: 0 auto;"}
1821

19-
The Cadwork Python API documentation is available as an MCP server, which transforms how you can learn and work with the API:
22+
## Demo
2023

21-
- **Contextual Answers**: Ask questions in natural language and get responses that reference the actual API documentation, including function signatures, parameters, and code examples.
22-
- **Code Generation**: Request script snippets for specific tasks. The AI can generate code using the correct Cadwork API functions because it has direct access to the documentation.
23-
- **Discovery**: Explore available modules and functions by simply asking "What functions are available for geometry operations?" or "How do I work with elements?"
24-
- **Troubleshooting**: Describe an error or unexpected behavior, and get help that's grounded in the actual API specifications.
24+
See how easy it is to use the Cadwork Python API with an MCP-enabled AI assistant:
2525

26+
![MCP Demo with Gemini CLI](img/mcp/gemini-mcp.gif){width=900}
27+
28+
You can use the Cadwork Python MCP for:
29+
30+
- **Contextual Answers**: Ask questions in natural language and get responses that reference the actual API
31+
documentation, including function signatures, parameters, and code examples.
32+
- **Code Generation**: Request script snippets for specific tasks. The AI can generate code using the correct Cadwork
33+
API functions because it has direct access to the documentation.
34+
- **Discovery**: Explore available modules and functions by simply asking "What functions are available for geometry
35+
operations?" or "How do I work with elements?"
36+
- **Troubleshooting**: Describe an error or unexpected behavior, and get help that's grounded in the actual API
37+
specifications.
2638

2739
## Setup instructions
2840

29-
To use the Cadwork Python API documentation as an MCP server, you need to configure your AI assistant to connect to it. Here are the most common ai code assistants and how to configure them:
41+
To use the Cadwork Python API documentation as an MCP server, you need to configure your AI assistant to connect to it.
42+
Here are the most common ai code assistants and how to configure them:
43+
44+
3045

3146
??? note "Claude Desktop"
47+
3248
Add the following to your Claude Desktop configuration file via the UI:
3349

3450
`Settings` > `Connectors` > `Add custom connectors`
3551

3652
[Claude MCP Documentation](https://modelcontextprotocol.io/docs/develop/connect-remote-servers){target=_blank}
3753

3854
??? note "Claude Code (CLI)"
55+
3956
Claude Code supports MCP servers natively. Add the server using:
4057

4158
```bash
@@ -45,7 +62,9 @@ To use the Cadwork Python API documentation as an MCP server, you need to config
4562
[Claude Code MCP Guide](https://docs.anthropic.com/en/docs/claude-code/mcp){target=_blank}
4663

4764
??? note "ChatGPT"
48-
ChatGPT does support MCP servers connector (they are called App) but only on *developer mode*. You need to activate it first and then:
65+
66+
ChatGPT does support MCP servers connector (they are called App) but only on *developer mode*. You need to activate it
67+
first and then:
4968

5069
`Settings` > `Apps` > `Create app` (Developer mode: on) > `Create app`
5170

@@ -56,6 +75,7 @@ To use the Cadwork Python API documentation as an MCP server, you need to config
5675
[OpenAI Plugins Documentation](https://help.openai.com/en/articles/11487775-apps-in-chatgpt#building-your-own-app){target=_blank}
5776

5877
??? note "VS Code (GitHub Copilot)"
78+
5979
Add the following to your VS Code settings file (`.vscode/mcp.json` in your workspace or user settings):
6080

6181
```json
@@ -71,6 +91,28 @@ To use the Cadwork Python API documentation as an MCP server, you need to config
7191

7292
[VS Code MCP Documentation](https://code.visualstudio.com/docs/copilot/chat/mcp-servers){target=_blank}
7393

74-
## Usage
94+
??? note "Gemini CLI"
95+
96+
Gemini CLI supports MCP servers natively through its command-line interface.
97+
98+
**Prerequisites**: Install the Gemini CLI first:
99+
100+
```bash
101+
npm install -g @google/gemini-cli@latest
102+
```
103+
104+
**Add the server**:
105+
106+
```bash
107+
gemini mcp add --transport http cadwork-pyapi https://pyapi.mcp.cadwork.dev/mcp
108+
```
109+
110+
**Verify the connection**:
111+
112+
```bash
113+
gemini mcp list
114+
```
115+
116+
Once added, the Cadwork Python API documentation will be automatically available when you interact with Gemini CLI.
75117

76-
Once configured, prompt your request to your AI coding assistant and it will automatically query the Cadwork Python API documentation to help you write grounded scripts to our Cadwork Python API.
118+
[Gemini MCP Guide](https://geminicli.com/docs/tools/mcp-server){target=_blank}

0 commit comments

Comments
 (0)