Skip to content

Commit 84c1ed6

Browse files
feat: Initial commit
0 parents  commit 84c1ed6

File tree

103 files changed

+13346
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+13346
-0
lines changed

.github/workflows/changelog.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
update:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
ref: main
19+
20+
- name: Update Changelog
21+
uses: stefanzweifel/changelog-updater-action@v1
22+
with:
23+
latest-version: ${{ github.event.release.name }}
24+
release-notes: ${{ github.event.release.body }}
25+
26+
- name: Commit updated CHANGELOG
27+
uses: stefanzweifel/git-auto-commit-action@v5
28+
with:
29+
branch: main
30+
commit_message: Update CHANGELOG
31+
file_pattern: CHANGELOG.md

.github/workflows/tests.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: tests
2+
3+
on: ['push', 'pull_request']
4+
5+
jobs:
6+
ci:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-latest, macos-latest, windows-latest]
13+
php: [8.1, 8.2, 8.3, 8.4]
14+
max-parallel: 4
15+
16+
name: Tests PHP${{ matrix.php }} - ${{ matrix.os }}
17+
18+
steps:
19+
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Cache dependencies
24+
uses: actions/cache@v4
25+
with:
26+
path: ~/.composer/cache/files
27+
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
28+
29+
- name: Setup PHP
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: ${{ matrix.php }}
33+
coverage: none
34+
35+
- name: Install Composer dependencies
36+
run: composer update --no-interaction --prefer-dist
37+
38+
- name: Run Tests
39+
run: composer test

.gitignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Composer dependencies
2+
/vendor/
3+
/composer.lock
4+
5+
# PHPUnit
6+
.phpunit.result.cache
7+
8+
# PHP CS Fixer
9+
/.php-cs-fixer.cache
10+
/.php-cs-fixer.php
11+
12+
# Editor directories and files
13+
/.idea
14+
/.vscode
15+
*.sublime-project
16+
*.sublime-workspace
17+
18+
# Operating system files
19+
.DS_Store
20+
Thumbs.db
21+
22+
# Local environment files
23+
/.env
24+
/.env.backup
25+
/.env.local
26+
27+
# PHP CodeSniffer
28+
/.phpcs.xml
29+
/.phpcs.xml.dist
30+
/phpcs.xml
31+
/phpcs.xml.dist
32+
33+
# PHPStan
34+
/phpstan.neon
35+
/phpstan.neon.dist
36+
37+
# Local development tools
38+
/.php_cs
39+
/.php_cs.cache
40+
/.php_cs.dist
41+
/_ide_helper.php
42+
/.php-cs-fixer.php
43+
44+
# Build artifacts
45+
/build/
46+
/coverage/
47+
48+
# PHPUnit coverage reports
49+
/clover.xml
50+
/coverage.xml
51+
/coverage/
52+
53+
# Laravel generated files
54+
bootstrap/cache/
55+
.phpunit.result.cache
56+
57+
# Local Composer dependencies
58+
composer.phar
59+
60+
workbench
61+
playground
62+
63+
# Log files
64+
*.log
65+
66+
# Cache files
67+
cache

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Changelog
2+
3+
All notable changes to `php-mcp/client` will be documented in this file.

CONTRIBUTING.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Contributing to php-mcp/client
2+
3+
First off, thank you for considering contributing to `php-mcp/client`! We appreciate your time and effort. This project aims to provide a robust and easy-to-use PHP client for the Model Context Protocol.
4+
5+
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open-source project. In return, they should reciprocate that respect in addressing your issue, assessing changes, and helping you finalize your pull requests.
6+
7+
## How Can I Contribute?
8+
9+
There are several ways you can contribute:
10+
11+
* **Reporting Bugs:** If you find a bug, please open an issue on the GitHub repository. Include steps to reproduce, expected behavior, and actual behavior. Specify your PHP version, operating system, and relevant package versions.
12+
* **Suggesting Enhancements:** Open an issue to suggest new features or improvements to existing functionality. Explain the use case and why the enhancement would be valuable.
13+
* **Improving Documentation:** If you find errors, omissions, or areas that could be clearer in the README or code comments, please submit a pull request or open an issue.
14+
* **Writing Code:** Submit pull requests to fix bugs or add new features.
15+
16+
## Development Setup
17+
18+
1. **Fork the repository:** Click the "Fork" button on the [php-mcp/client GitHub page](https://github.com/php-mcp/client).
19+
2. **Clone your fork:** `git clone [email protected]:YOUR_USERNAME/client.git`
20+
3. **Navigate into the directory:** `cd client`
21+
4. **Install dependencies:** `composer install` (This installs runtime and development dependencies).
22+
23+
## Submitting Changes (Pull Requests)
24+
25+
1. **Create a new branch:** `git checkout -b feature/your-feature-name` or `git checkout -b fix/issue-number`.
26+
2. **Make your changes:** Write your code and accompanying tests.
27+
3. **Ensure Code Style:** Run the code style fixer (if configured, e.g., PHP CS Fixer):
28+
```bash
29+
composer lint # Or ./vendor/bin/php-cs-fixer fix
30+
```
31+
Adhere to PSR-12 coding standards.
32+
4. **Run Tests:** Ensure all tests pass:
33+
```bash
34+
composer test # Or ./vendor/bin/pest
35+
```
36+
Consider adding new tests for your changes. Aim for good test coverage.
37+
5. **Update Documentation:** If your changes affect the public API or usage, update the `README.md` and relevant PHPDoc blocks.
38+
6. **Commit your changes:** Use clear and descriptive commit messages. `git commit -m "feat: Add support for resource subscriptions"` or `git commit -m "fix: Correct handling of transport errors"`
39+
7. **Push to your fork:** `git push origin feature/your-feature-name`
40+
8. **Open a Pull Request:** Go to the original `php-mcp/client` repository on GitHub and open a pull request from your branch to the `main` branch (or the appropriate development branch).
41+
9. **Describe your changes:** Provide a clear description of the problem and solution in the pull request. Link to any relevant issues (`Closes #123`).
42+
43+
## Coding Standards
44+
45+
* Follow **PSR-12** coding standards.
46+
* Use **strict types:** `declare(strict_types=1);` at the top of PHP files.
47+
* Use **PHP 8.1+ features** where appropriate (readonly properties, enums, etc.).
48+
* Add **PHPDoc blocks** for all public classes, methods, and properties.
49+
* Write clear and concise code. Add comments only where necessary to explain complex logic.
50+
51+
## Reporting Issues
52+
53+
* Use the GitHub issue tracker.
54+
* Check if the issue already exists.
55+
* Provide a clear title and description.
56+
* Include steps to reproduce the issue, code examples, error messages, and stack traces if applicable.
57+
* Specify relevant environment details (PHP version, OS, package version).
58+
59+
Thank you for contributing!

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Kyrian Obikwelu
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)