You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example demonstrates how to use MXCP with Jira data using **plain Python endpoints** instead of plugins. This approach is simpler, more direct, and easier to debug than the plugin-based approach.
3
+
This example demonstrates how to use MXCP with Jira data using Python endpoints. This approach uses Python functions directly as MCP tools.
4
4
5
5
## Overview
6
6
@@ -11,13 +11,12 @@ This example provides Python MCP endpoints that allow you to:
11
11
- List projects and their details
12
12
- Get project metadata
13
13
14
-
## Key Differences from Plugin Approach
14
+
## Implementation Approach
15
15
16
-
-**No custom plugins required** - just plain Python functions
17
-
-**Direct MCP tool calls** - no SQL wrapper layer needed
18
-
-**Simpler configuration** - no plugin registration required
19
-
-**Easier debugging** - standard Python debugging works naturally
20
-
-**More flexible** - can return any JSON-serializable data
16
+
This example uses Python functions that are exposed as MCP tools:
17
+
- Python functions handle the Jira API interactions
18
+
- Tool definitions map to these Python functions
19
+
- Results are returned as JSON data
21
20
22
21
## Configuration
23
22
@@ -43,50 +42,34 @@ Add the following to your MXCP user config (`~/.mxcp/config.yml`):
43
42
mxcp: 1
44
43
45
44
projects:
46
-
jira-python-demo:
45
+
jira-demo:
47
46
profiles:
48
47
default:
49
48
secrets:
50
-
# JIRA credentials - using "python" type to demonstrate behavior
51
49
- name: "jira"
52
-
type: "python"# This will cause DuckDB injection to fail (but continue gracefully)
50
+
type: "python"
53
51
parameters:
54
52
url: "https://your-domain.atlassian.net"
55
53
username: "your-email@example.com"
56
54
password: "your-api-token"# Use the API token you created above
57
55
```
58
56
59
-
### Experimental Setup: DuckDB Secret Injection
60
-
61
-
This example is set up to demonstrate what happens when:
62
-
1. **Secret is required** - Listed in `mxcp-site.yml`'s `secrets` array
63
-
2. **Invalid DuckDB type** - Using `type: "python"` which DuckDB doesn't understand
64
-
65
-
**Expected behavior:**
66
-
- DuckDB injection will fail during startup (logged as debug message)
67
-
- Python endpoints will still work perfectly via `config.get_secret()`
68
-
- Server will continue running normally
69
-
70
-
This shows MXCP's graceful handling of unsupported secret types!
71
-
72
57
### 3. Site Configuration
73
58
74
59
Create an `mxcp-site.yml` file:
75
60
76
61
```yaml
77
62
mxcp: 1
78
-
project: jira-python-demo
63
+
project: jira-demo
79
64
profile: default
80
65
secrets:
81
-
- jira # This forces the secret to be injected into DuckDB
66
+
- jira
82
67
```
83
68
84
-
Note: We're listing the JIRA secret as required to demonstrate DuckDB injection behavior.
85
-
86
69
## Available Tools
87
70
88
71
### JQL Query
89
-
Execute JQL queries directly as Python function calls:
72
+
Execute JQL queries:
90
73
```bash
91
74
mxcp run tool jql_query --param query="project = TEST" --param limit=10
92
75
```
@@ -133,47 +116,11 @@ Get users and groups for a specific role in a project:
133
116
mxcp run tool get_project_role_users --param project_key="TEST" --param role_name="Developers"
134
117
```
135
118
136
-
137
-
138
-
## Example Usage
139
-
140
-
1. Start the MXCP server:
141
-
```bash
142
-
mxcp serve
143
-
```
144
-
145
-
2. Or run tools directly:
146
-
```bash
147
-
# Query recent issues
148
-
mxcp run tool jql_query --param query="project = TEST ORDER BY created DESC" --param limit=5
149
-
150
-
# Get specific issue details
151
-
mxcp run tool get_issue --param issue_key="RD-123"
152
-
153
-
# Get specific user by account ID
154
-
mxcp run tool get_user --param account_id="557058:ab168c94-8485-405c-88e6-6458375eb30b"
155
-
156
-
# Search for users
157
-
mxcp run tool search_user --param query="admin"
158
-
159
-
# List all projects
160
-
mxcp run tool list_projects
161
-
162
-
# Get specific project
163
-
mxcp run tool get_project --param project_key="TEST"
164
-
165
-
# Get project roles
166
-
mxcp run tool get_project_roles --param project_key="TEST"
167
-
168
-
# Get users for specific role
169
-
mxcp run tool get_project_role_users --param project_key="TEST" --param role_name="Developers"
170
-
```
171
-
172
119
## Project Structure
173
120
174
121
```
175
122
jira-python/
176
-
├── mxcp-site.yml # Simple site configuration
123
+
├── mxcp-site.yml # Site configuration
177
124
├── python/ # Python implementations
178
125
│ └── jira_endpoints.py # All JIRA endpoint functions
179
126
├── tools/ # Tool definitions
@@ -186,29 +133,4 @@ jira-python/
186
133
│ ├── get_project_roles.yml
187
134
│ └── get_project_role_users.yml
188
135
└── README.md
189
-
```
190
-
191
-
## Key Features
192
-
193
-
- **Direct Python Functions**: No SQL wrapper layer needed
194
-
- **Async Support**: Functions can be async for better performance
195
-
- **Database Integration**: Can optionally store results in DuckDB
196
-
- **Error Handling**: Proper error responses for invalid requests
197
-
- **Type Safety**: Full type hints for better IDE support
198
-
- **Logging**: Comprehensive logging for debugging
199
-
200
-
## Migration from Plugin Approach
201
-
202
-
This example demonstrates how much simpler the Python endpoint approach is:
This example demonstrates how to use MXCP with Salesforce data using **plain Python endpoints** instead of plugins. This approach is simpler, more direct, and easier to debug than the plugin-based approach.
3
+
This example demonstrates how to use MXCP with Salesforce data using **Python endpoints**.
4
4
5
5
## Overview
6
6
@@ -12,14 +12,6 @@ This example provides Python MCP endpoints that allow you to:
12
12
- Retrieve specific records by ID
13
13
- Perform simple text searches across common objects
14
14
15
-
## Key Differences from Plugin Approach
16
-
17
-
-**No custom plugins required** - just plain Python functions
18
-
-**Direct MCP tool calls** - no SQL wrapper layer needed
19
-
-**Simpler configuration** - no plugin registration required
20
-
-**Easier debugging** - standard Python debugging works naturally
21
-
-**More flexible** - can return any JSON-serializable data
22
-
23
15
## Configuration
24
16
25
17
### 1. Getting Salesforce Credentials
@@ -105,39 +97,11 @@ Get a specific record by its ID:
105
97
mxcp run tool get_sobject --param sobject_name="Account" --param record_id="001xx000003DIloAAG"
106
98
```
107
99
108
-
## Example Usage
109
-
110
-
1. Start the MXCP server:
111
-
```bash
112
-
mxcp serve
113
-
```
114
-
115
-
2. Or run tools directly:
116
-
```bash
117
-
# List all available objects
118
-
mxcp run tool list_sobjects
119
-
120
-
# Get Account object description
121
-
mxcp run tool describe_sobject --param sobject_name="Account"
122
-
123
-
# Query all accounts
124
-
mxcp run tool soql --param query="SELECT Id, Name, Phone FROM Account LIMIT 10"
125
-
126
-
# Search for records containing "Acme"
127
-
mxcp run tool search --param search_term="Acme"
128
-
129
-
# Get specific account by ID
130
-
mxcp run tool get_sobject --param sobject_name="Account" --param record_id="001xx000003DIloAAG"
131
-
132
-
# Execute SOSL search
133
-
mxcp run tool sosl --param query="FIND {John} IN NAME FIELDS RETURNING Contact(FirstName, LastName, Email)"
134
-
```
135
-
136
100
## Project Structure
137
101
138
102
```
139
103
salesforce/
140
-
├── mxcp-site.yml # Simple site configuration
104
+
├── mxcp-site.yml # Site configuration
141
105
├── python/ # Python implementations
142
106
│ └── salesforce_endpoints.py # All Salesforce endpoint functions
143
107
├── tools/ # Tool definitions
@@ -148,59 +112,4 @@ salesforce/
148
112
│ ├── describe_sobject.yml
149
113
│ └── get_sobject.yml
150
114
└── README.md
151
-
```
152
-
153
-
## Key Features
154
-
155
-
- **Direct Python Functions**: No SQL wrapper layer needed
156
-
- **Async Support**: Functions can be async for better performance
157
-
- **Database Integration**: Can optionally store results in DuckDB
158
-
- **Error Handling**: Proper error responses for invalid requests
159
-
- **Type Safety**: Full type hints for better IDE support
160
-
- **Logging**: Comprehensive logging for debugging
161
-
162
-
## Migration from Plugin Approach
163
-
164
-
This example demonstrates how much simpler the Python endpoint approach is:
0 commit comments