Skip to content

Commit 979c7ed

Browse files
committed
fixup! jira
wip
1 parent 49de678 commit 979c7ed

File tree

2 files changed

+16
-185
lines changed

2 files changed

+16
-185
lines changed

examples/jira/README.md

Lines changed: 13 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MXCP Jira Python Endpoints Example
22

3-
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.
44

55
## Overview
66

@@ -11,13 +11,12 @@ This example provides Python MCP endpoints that allow you to:
1111
- List projects and their details
1212
- Get project metadata
1313

14-
## Key Differences from Plugin Approach
14+
## Implementation Approach
1515

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
2120

2221
## Configuration
2322

@@ -43,50 +42,34 @@ Add the following to your MXCP user config (`~/.mxcp/config.yml`):
4342
mxcp: 1
4443

4544
projects:
46-
jira-python-demo:
45+
jira-demo:
4746
profiles:
4847
default:
4948
secrets:
50-
# JIRA credentials - using "python" type to demonstrate behavior
5149
- name: "jira"
52-
type: "python" # This will cause DuckDB injection to fail (but continue gracefully)
50+
type: "python"
5351
parameters:
5452
url: "https://your-domain.atlassian.net"
5553
username: "your-email@example.com"
5654
password: "your-api-token" # Use the API token you created above
5755
```
5856
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-
7257
### 3. Site Configuration
7358
7459
Create an `mxcp-site.yml` file:
7560

7661
```yaml
7762
mxcp: 1
78-
project: jira-python-demo
63+
project: jira-demo
7964
profile: default
8065
secrets:
81-
- jira # This forces the secret to be injected into DuckDB
66+
- jira
8267
```
8368

84-
Note: We're listing the JIRA secret as required to demonstrate DuckDB injection behavior.
85-
8669
## Available Tools
8770

8871
### JQL Query
89-
Execute JQL queries directly as Python function calls:
72+
Execute JQL queries:
9073
```bash
9174
mxcp run tool jql_query --param query="project = TEST" --param limit=10
9275
```
@@ -133,47 +116,11 @@ Get users and groups for a specific role in a project:
133116
mxcp run tool get_project_role_users --param project_key="TEST" --param role_name="Developers"
134117
```
135118

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-
172119
## Project Structure
173120

174121
```
175122
jira-python/
176-
├── mxcp-site.yml # Simple site configuration
123+
├── mxcp-site.yml # Site configuration
177124
├── python/ # Python implementations
178125
│ └── jira_endpoints.py # All JIRA endpoint functions
179126
├── tools/ # Tool definitions
@@ -186,29 +133,4 @@ jira-python/
186133
│ ├── get_project_roles.yml
187134
│ └── get_project_role_users.yml
188135
└── 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:
203-
204-
- **Plugin approach**: Plugin class → UDFs → SQL calls → Tool definitions
205-
- **Python approach**: Python functions → Tool definitions
206-
207-
The functionality is identical, but the implementation is much more straightforward!
208-
209-
## Notes
210-
211-
- Make sure to keep your API token secure and never commit it to version control
212-
- The plugin requires proper authentication and API permissions to work with your Jira instance
213-
- Functions return JSON data that can be directly used by MCP clients
214-
- Results can optionally be stored in DuckDB for further SQL analysis
136+
```

examples/salesforce/README.md

Lines changed: 3 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MXCP Salesforce Python Endpoints Example
22

3-
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**.
44

55
## Overview
66

@@ -12,14 +12,6 @@ This example provides Python MCP endpoints that allow you to:
1212
- Retrieve specific records by ID
1313
- Perform simple text searches across common objects
1414

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-
2315
## Configuration
2416

2517
### 1. Getting Salesforce Credentials
@@ -105,39 +97,11 @@ Get a specific record by its ID:
10597
mxcp run tool get_sobject --param sobject_name="Account" --param record_id="001xx000003DIloAAG"
10698
```
10799

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-
136100
## Project Structure
137101

138102
```
139103
salesforce/
140-
├── mxcp-site.yml # Simple site configuration
104+
├── mxcp-site.yml # Site configuration
141105
├── python/ # Python implementations
142106
│ └── salesforce_endpoints.py # All Salesforce endpoint functions
143107
├── tools/ # Tool definitions
@@ -148,59 +112,4 @@ salesforce/
148112
│ ├── describe_sobject.yml
149113
│ └── get_sobject.yml
150114
└── 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:
165-
166-
- **Plugin approach**: Plugin class → UDFs → SQL calls → Tool definitions
167-
- **Python approach**: Python functions → Tool definitions
168-
169-
The functionality is identical, but the implementation is much more straightforward!
170-
171-
## Common Use Cases
172-
173-
### 1. Explore Your Salesforce Org
174-
```bash
175-
# First, see what objects are available
176-
mxcp run tool list_sobjects
177-
178-
# Then describe an object to see its fields
179-
mxcp run tool describe_sobject --param sobject_name="Account"
180-
```
181-
182-
### 2. Query Specific Data
183-
```bash
184-
# Get all accounts in a specific city
185-
mxcp run tool soql --param query="SELECT Id, Name, Phone FROM Account WHERE BillingCity = 'New York'"
186-
187-
# Get contacts for a specific account
188-
mxcp run tool soql --param query="SELECT Id, Name, Email FROM Contact WHERE AccountId = '001xx000003DIloAAG'"
189-
```
190-
191-
### 3. Search for Records
192-
```bash
193-
# Find all records mentioning "Acme"
194-
mxcp run tool search --param search_term="Acme"
195-
196-
# More specific SOSL search
197-
mxcp run tool sosl --param query="FIND {Acme} IN ALL FIELDS RETURNING Account(Name, Phone), Contact(FirstName, LastName)"
198-
```
199-
200-
## Notes
201-
202-
- Make sure to keep your Salesforce credentials secure and never commit them to version control
203-
- The example requires proper authentication and API permissions to work with your Salesforce instance
204-
- Functions return JSON data that can be directly used by MCP clients
205-
- Results can optionally be stored in DuckDB for further SQL analysis
206-
- All query results have the 'attributes' field removed for cleaner output
115+
```

0 commit comments

Comments
 (0)