Acme-MCP
view release on metacpan or search on metacpan
CONTRIBUTING.md view on Meta::CPAN
First off, thank you for considering contributing!
## Code of Conduct
This project and everyone participating in it is governed by our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
## How to Contribute
We use a standard GitHub fork-and-pull-request workflow.
1. **Find or Create an Issue**: Before starting significant work, please check the [issue tracker](https://github.com/sanko/Acme-MCP.pm/issues) to see if there's an existing issue for what you want to do.
If not, please create one to start a discussion. This ensures that your proposed change aligns with the project's goals before you invest time in it.
2. **Fork the Repository**: Start by forking the main repository to your own GitHub account.
3. **Create a Branch**: Create a new branch for your feature or bugfix from the `main` branch. Please use a descriptive name.
```bash
# For a new feature:
git checkout -b feature/add-riscv-support
# For a bug fix:
git checkout -b fix/struct-classification-bug
```
lib/Acme/MCP.pm view on Meta::CPAN
#
method add_tool (%params) {
my $name = $params{name} or croak 'Tool name required';
my $code = $params{code} or croak 'Tool code (sub) required';
$tools{$name}
= { description => $params{description} // '', inputSchema => $params{schema} // { type => 'object', properties => {} }, code => $code };
}
method run () {
$| = 1; # Autoflush for stdio communication
carp "$name started, listening on STDIN";
while ( my $line = <STDIN> ) {
chomp $line;
my $request;
try { $request = $json->decode($line) }
catch ($e) {
$self->_send_error( undef, -32700, 'Parse error' );
next;
}
$self->_handle_request($request);
}
( run in 0.478 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )