Import redMCP into Redmine repo

This commit is contained in:
Jason Thistlethwaite
2026-04-24 22:09:37 +00:00
parent 780d9a0922
commit 4380824618
9 changed files with 673 additions and 5 deletions
+54
View File
@@ -0,0 +1,54 @@
This project is for creating a simple library and MCP server for handling Redmine, particularly for when Redmine is being used for customer service/support.
This is a private project for now, as it pertains to an installation of Redmine 3.4.4-stable used by LDR, which also uses some outdated plugins. Notably, the outdated pluggins in use are both from Redmine Up (contacts, helpdesk/crm).
This is about creating the basic tools that an agent would need in order to interact with and automate LDR's redmine communications. Some of the functionality will extend beyond Redmine.
## Notable issues to be aware of
Projects which have the modules "contacts" or "contacts_helpdesk" enabled have the Helpdesk plugins enabled. That means a few things:
The regular API call to fetch an issue will not necessarily return the helpdesk information. Instead, it may claim that the issue's author or journals were created by "anonymous". When getting these issues, we need to use a different way to handle it.
The project in /home/iadnah/redmine/ is related to this problem.
## Client shape
`RedMCP\RedmineClient` wraps the normal Redmine REST client and composes
Helpdesk context in application logic instead of modifying Redmine's core issue
API.
```php
$client = RedMCP\RedmineClient::fromCredentials('http://192.168.50.170', $apiKey);
$context = $client->issueWithHelpdesk(39858);
```
The returned array has:
- `issue`: the normal `/issues/:id.json` response
- `helpdesk.ticket`: metadata from `/helpdesk_search/issues/:id/ticket`, or
`null`
- `helpdesk.journal_messages`: metadata from
`/helpdesk_search/issues/:id/messages`
Basic issue CRUD is exposed on the same wrapper:
```php
$issues = $client->issues(['project_id' => 'customer-service', 'status_id' => 'open', 'limit' => 10]);
$issue = $client->issue(39858);
$created = $client->createIssue([
'project_id' => 78,
'subject' => 'Example issue from redMCP',
'description' => 'Created through the Redmine REST API wrapper.',
]);
$client->updateIssue((int) $created['id'], ['notes' => 'Follow-up note']);
$client->deleteIssue((int) $created['id']);
```
## Test instance
A working test copy of Redmine is available on the LAN at `192.168.50.170`.
The related Redmine plugin forks, helper scripts, and operational docs live in
the parent repository.