mcpyida 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcpyida-0.6.0/.github/workflows/ci.yml +80 -0
- mcpyida-0.6.0/.github/workflows/release.yml +98 -0
- mcpyida-0.6.0/.gitignore +67 -0
- mcpyida-0.6.0/CODE_OF_CONDUCT.md +84 -0
- mcpyida-0.6.0/CONTRIBUTING.md +182 -0
- mcpyida-0.6.0/LICENSE +202 -0
- mcpyida-0.6.0/NOTICE +22 -0
- mcpyida-0.6.0/PKG-INFO +212 -0
- mcpyida-0.6.0/README.md +179 -0
- mcpyida-0.6.0/SECURITY.md +50 -0
- mcpyida-0.6.0/docs/index.md +45 -0
- mcpyida-0.6.0/docs/installation.md +374 -0
- mcpyida-0.6.0/docs/mcp-client-config.md +221 -0
- mcpyida-0.6.0/docs/quickstart.md +250 -0
- mcpyida-0.6.0/docs/specs/rpc-callbacks.md +358 -0
- mcpyida-0.6.0/docs/tools-reference.md +780 -0
- mcpyida-0.6.0/examples/type_tools_usage.py +184 -0
- mcpyida-0.6.0/pyproject.toml +191 -0
- mcpyida-0.6.0/src/__init__.py +0 -0
- mcpyida-0.6.0/src/mcpyida/__init__.py +0 -0
- mcpyida-0.6.0/src/mcpyida/_version.py +24 -0
- mcpyida-0.6.0/src/mcpyida/custom_types_312.py +11 -0
- mcpyida-0.6.0/src/mcpyida/custom_types_p312.py +5 -0
- mcpyida-0.6.0/src/mcpyida/headless.py +197 -0
- mcpyida-0.6.0/src/mcpyida/ida_helpers.py +687 -0
- mcpyida-0.6.0/src/mcpyida/ida_plugin/mcpyida_proxy.py +9 -0
- mcpyida-0.6.0/src/mcpyida/installer.py +32 -0
- mcpyida-0.6.0/src/mcpyida/mcp2openapi.py +197 -0
- mcpyida-0.6.0/src/mcpyida/mcpserver.py +405 -0
- mcpyida-0.6.0/src/mcpyida/mcpyida.py +327 -0
- mcpyida-0.6.0/src/mcpyida/models.py +365 -0
- mcpyida-0.6.0/src/mcpyida/py.typed +0 -0
- mcpyida-0.6.0/src/mcpyida/rpc_callbacks.py +336 -0
- mcpyida-0.6.0/src/mcpyida/rpc_types.py +66 -0
- mcpyida-0.6.0/src/mcpyida/server.py +1945 -0
- mcpyida-0.6.0/src/mcpyida/tools/__init__.py +14 -0
- mcpyida-0.6.0/src/mcpyida/tools/analysis.py +544 -0
- mcpyida-0.6.0/src/mcpyida/tools/cfg.py +470 -0
- mcpyida-0.6.0/src/mcpyida/tools/core.py +890 -0
- mcpyida-0.6.0/src/mcpyida/tools/modify.py +600 -0
- mcpyida-0.6.0/src/mcpyida/tools/scripting.py +292 -0
- mcpyida-0.6.0/src/mcpyida/tools/search.py +323 -0
- mcpyida-0.6.0/src/mcpyida/tools/search_utils.py +102 -0
- mcpyida-0.6.0/src/mcpyida/tools/types.py +738 -0
- mcpyida-0.6.0/src/mcpyida/util.py +200 -0
- mcpyida-0.6.0/tests/__init__.py +0 -0
- mcpyida-0.6.0/tests/conftest.py +23 -0
- mcpyida-0.6.0/tests/e2e/__init__.py +0 -0
- mcpyida-0.6.0/tests/e2e/conftest.py +188 -0
- mcpyida-0.6.0/tests/e2e/test_all_tools.py +1494 -0
- mcpyida-0.6.0/tests/e2e/test_cfg_callgraph.py +307 -0
- mcpyida-0.6.0/tests/e2e/test_concurrency.py +84 -0
- mcpyida-0.6.0/tests/e2e/test_headless_launch.py +73 -0
- mcpyida-0.6.0/tests/e2e/test_rpc_callbacks.py +594 -0
- mcpyida-0.6.0/tests/fixtures/Makefile +25 -0
- mcpyida-0.6.0/tests/fixtures/crackme.c +30 -0
- mcpyida-0.6.0/tests/fixtures/crackme.elf +0 -0
- mcpyida-0.6.0/tests/fixtures/struct_test.c +79 -0
- mcpyida-0.6.0/tests/fixtures/struct_test.elf +0 -0
- mcpyida-0.6.0/tests/fixtures/typed_fixture.c +42 -0
- mcpyida-0.6.0/tests/fixtures/typed_fixture.elf +0 -0
- mcpyida-0.6.0/tests/integration/__init__.py +0 -0
- mcpyida-0.6.0/tests/integration/conftest.py +183 -0
- mcpyida-0.6.0/tests/integration/helpers.py +29 -0
- mcpyida-0.6.0/tests/integration/test_analysis.py +327 -0
- mcpyida-0.6.0/tests/integration/test_cfg.py +142 -0
- mcpyida-0.6.0/tests/integration/test_core.py +176 -0
- mcpyida-0.6.0/tests/integration/test_scripting.py +131 -0
- mcpyida-0.6.0/tests/integration/test_search.py +132 -0
- mcpyida-0.6.0/tests/test_structure_tools.py +65 -0
- mcpyida-0.6.0/tests/unit/__init__.py +0 -0
- mcpyida-0.6.0/tests/unit/test_batch.py +125 -0
- mcpyida-0.6.0/tests/unit/test_cfg_normalization.py +359 -0
- mcpyida-0.6.0/tests/unit/test_elicitation.py +166 -0
- mcpyida-0.6.0/tests/unit/test_idapro_optional.py +170 -0
- mcpyida-0.6.0/tests/unit/test_models.py +686 -0
- mcpyida-0.6.0/tests/unit/test_rpc_callbacks.py +715 -0
- mcpyida-0.6.0/tests/unit/test_rpc_server_integration.py +1446 -0
- mcpyida-0.6.0/tests/unit/test_rpc_types.py +228 -0
- mcpyida-0.6.0/tests/unit/test_search_utils.py +73 -0
- mcpyida-0.6.0/tests/unit/test_server_info.py +211 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
# Scope of this workflow
|
|
4
|
+
# ──────────────────────
|
|
5
|
+
# Integration and e2e tests require a live IDA Pro / idalib installation,
|
|
6
|
+
# which is not available on stock GitHub runners (IDA Pro is proprietary
|
|
7
|
+
# commercial software and cannot be bundled into public CI images). Those
|
|
8
|
+
# tiers run in a separate CI environment with an IDA Pro license.
|
|
9
|
+
#
|
|
10
|
+
# This workflow runs LINT + TYPECHECK ONLY:
|
|
11
|
+
# • Lint — ruff check + ruff format --check (src/)
|
|
12
|
+
# • Typecheck — mypy (config in pyproject.toml; targets src/mcpyida;
|
|
13
|
+
# IDA modules are Any-typed via overrides so it needs no IDA)
|
|
14
|
+
#
|
|
15
|
+
# Tests are not run here: the unit suite hard-imports IDAPython modules
|
|
16
|
+
# (idaapi, ida_pro, ida_typeinf, …) which require a real IDA installation, so
|
|
17
|
+
# it cannot run on a stock GitHub runner. All test tiers (unit, integration,
|
|
18
|
+
# e2e) run in the licensed CI environment described above.
|
|
19
|
+
#
|
|
20
|
+
# Python matrix: 3.10, 3.11, 3.12 (matches pyproject.toml requires-python).
|
|
21
|
+
|
|
22
|
+
on:
|
|
23
|
+
push:
|
|
24
|
+
branches: [main]
|
|
25
|
+
pull_request:
|
|
26
|
+
branches: [main]
|
|
27
|
+
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
|
|
31
|
+
concurrency:
|
|
32
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
33
|
+
cancel-in-progress: true
|
|
34
|
+
|
|
35
|
+
jobs:
|
|
36
|
+
test:
|
|
37
|
+
name: Python ${{ matrix.python-version }}
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
|
|
40
|
+
strategy:
|
|
41
|
+
fail-fast: false
|
|
42
|
+
matrix:
|
|
43
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
44
|
+
|
|
45
|
+
steps:
|
|
46
|
+
- name: Checkout
|
|
47
|
+
uses: actions/checkout@v4
|
|
48
|
+
with:
|
|
49
|
+
# Full history needed by hatch-vcs to derive version from tags
|
|
50
|
+
fetch-depth: 0
|
|
51
|
+
|
|
52
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
53
|
+
uses: actions/setup-python@v5
|
|
54
|
+
with:
|
|
55
|
+
python-version: ${{ matrix.python-version }}
|
|
56
|
+
cache: pip
|
|
57
|
+
|
|
58
|
+
- name: Install dependencies
|
|
59
|
+
run: |
|
|
60
|
+
pip install --upgrade pip
|
|
61
|
+
pip install -e ".[dev]"
|
|
62
|
+
|
|
63
|
+
- name: Lint (ruff check)
|
|
64
|
+
# Scope: src/ only.
|
|
65
|
+
run: ruff check src
|
|
66
|
+
|
|
67
|
+
- name: Format check (ruff format)
|
|
68
|
+
run: ruff format --check src
|
|
69
|
+
|
|
70
|
+
- name: Type-check (mypy)
|
|
71
|
+
# mypy config in pyproject.toml sets packages = ["mcpyida"] and
|
|
72
|
+
# mypy_path = "src", so bare `mypy` resolves without an explicit path.
|
|
73
|
+
# IDA Pro API modules are Any-typed via [[tool.mypy.overrides]] stubs (the
|
|
74
|
+
# IDA Python API has no public type stubs; idalib is dlopen-loaded at runtime).
|
|
75
|
+
# warn_return_any is intentionally disabled to avoid ~80 false-positive ignores
|
|
76
|
+
# on IDA wrapper return sites.
|
|
77
|
+
run: mypy
|
|
78
|
+
|
|
79
|
+
# No pytest here: the test suite requires a real IDA install. Tests run
|
|
80
|
+
# in the licensed CI environment described in the header.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# release.yml — Publish to PyPI on version tag push.
|
|
2
|
+
#
|
|
3
|
+
# PREREQUISITE (one-time setup):
|
|
4
|
+
# PyPI-side OIDC trusted publisher must be configured before this workflow
|
|
5
|
+
# can publish. In your PyPI project settings, add a "pending publisher" with:
|
|
6
|
+
# Owner: nightwing-us
|
|
7
|
+
# Repository: mcpyida
|
|
8
|
+
# Workflow: release.yml
|
|
9
|
+
# Environment: pypi
|
|
10
|
+
#
|
|
11
|
+
# See: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
|
|
12
|
+
#
|
|
13
|
+
# This workflow uses no stored PyPI API token. Authentication is handled
|
|
14
|
+
# entirely via GitHub's OIDC identity and PyPI's trusted publisher mechanism.
|
|
15
|
+
|
|
16
|
+
name: Release
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
push:
|
|
20
|
+
tags:
|
|
21
|
+
- "v*"
|
|
22
|
+
|
|
23
|
+
permissions:
|
|
24
|
+
contents: read
|
|
25
|
+
id-token: write # Required for PyPI OIDC trusted publisher authentication
|
|
26
|
+
|
|
27
|
+
jobs:
|
|
28
|
+
build:
|
|
29
|
+
name: Build distribution
|
|
30
|
+
runs-on: ubuntu-latest
|
|
31
|
+
|
|
32
|
+
steps:
|
|
33
|
+
- name: Checkout
|
|
34
|
+
uses: actions/checkout@v4
|
|
35
|
+
with:
|
|
36
|
+
# Full history needed by hatch-vcs to determine version from tags
|
|
37
|
+
fetch-depth: 0
|
|
38
|
+
|
|
39
|
+
- name: Set up Python
|
|
40
|
+
uses: actions/setup-python@v5
|
|
41
|
+
with:
|
|
42
|
+
python-version: "3.12"
|
|
43
|
+
cache: pip
|
|
44
|
+
|
|
45
|
+
- name: Install build tooling
|
|
46
|
+
run: pip install build
|
|
47
|
+
|
|
48
|
+
- name: Build wheel and sdist
|
|
49
|
+
run: python -m build
|
|
50
|
+
|
|
51
|
+
- name: Upload distribution artifacts
|
|
52
|
+
uses: actions/upload-artifact@v4
|
|
53
|
+
with:
|
|
54
|
+
name: dist
|
|
55
|
+
path: dist/
|
|
56
|
+
|
|
57
|
+
publish-pypi:
|
|
58
|
+
name: Publish to PyPI
|
|
59
|
+
needs: build
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
environment: pypi # Must match the environment name in PyPI OIDC config
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
- name: Download distribution artifacts
|
|
65
|
+
uses: actions/download-artifact@v4
|
|
66
|
+
with:
|
|
67
|
+
name: dist
|
|
68
|
+
path: dist/
|
|
69
|
+
|
|
70
|
+
- name: Publish to PyPI
|
|
71
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
72
|
+
# No token= needed; authentication is via OIDC (id-token: write above)
|
|
73
|
+
|
|
74
|
+
github-release:
|
|
75
|
+
name: Create GitHub Release
|
|
76
|
+
needs: publish-pypi
|
|
77
|
+
runs-on: ubuntu-latest
|
|
78
|
+
permissions:
|
|
79
|
+
contents: write # Required to create the release
|
|
80
|
+
|
|
81
|
+
steps:
|
|
82
|
+
- name: Download distribution artifacts
|
|
83
|
+
uses: actions/download-artifact@v4
|
|
84
|
+
with:
|
|
85
|
+
name: dist
|
|
86
|
+
path: dist/
|
|
87
|
+
|
|
88
|
+
- name: Create GitHub Release
|
|
89
|
+
env:
|
|
90
|
+
GH_TOKEN: ${{ github.token }}
|
|
91
|
+
# Use the preinstalled `gh` CLI (GitHub-owned, always allowed by
|
|
92
|
+
# restrictive org action policies) instead of a third-party action.
|
|
93
|
+
run: |
|
|
94
|
+
gh release create "${GITHUB_REF_NAME}" \
|
|
95
|
+
--repo "${GITHUB_REPOSITORY}" \
|
|
96
|
+
--title "${GITHUB_REF_NAME}" \
|
|
97
|
+
--generate-notes \
|
|
98
|
+
dist/*
|
mcpyida-0.6.0/.gitignore
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.pyc
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.so
|
|
9
|
+
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
dist/
|
|
12
|
+
build/
|
|
13
|
+
*.egg-info/
|
|
14
|
+
|
|
15
|
+
# Virtual environments
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
.env/
|
|
19
|
+
.venv/
|
|
20
|
+
|
|
21
|
+
# Unit test / coverage reports
|
|
22
|
+
htmlcov/
|
|
23
|
+
.tox/
|
|
24
|
+
.coverage
|
|
25
|
+
.coverage.*
|
|
26
|
+
.cache
|
|
27
|
+
nosetests.xml
|
|
28
|
+
coverage.xml
|
|
29
|
+
*.cover
|
|
30
|
+
.hypothesis/
|
|
31
|
+
.pytest_cache/
|
|
32
|
+
|
|
33
|
+
# mypy
|
|
34
|
+
.mypy_cache/
|
|
35
|
+
.dmypy.json
|
|
36
|
+
dmypy.json
|
|
37
|
+
|
|
38
|
+
# JVM crash reports (idalib)
|
|
39
|
+
hs_err_pid*.log
|
|
40
|
+
|
|
41
|
+
# IDE specific files
|
|
42
|
+
.idea/
|
|
43
|
+
.vscode/
|
|
44
|
+
*.swp
|
|
45
|
+
*.swo
|
|
46
|
+
|
|
47
|
+
# Local development configuration
|
|
48
|
+
.python-version
|
|
49
|
+
|
|
50
|
+
# joe editor backup files
|
|
51
|
+
*~
|
|
52
|
+
|
|
53
|
+
src/mcpyida/_version.py
|
|
54
|
+
# IDA database files
|
|
55
|
+
tests/fixtures/*.id0
|
|
56
|
+
tests/fixtures/*.id1
|
|
57
|
+
tests/fixtures/*.id2
|
|
58
|
+
tests/fixtures/*.nam
|
|
59
|
+
tests/fixtures/*.til
|
|
60
|
+
tests/fixtures/*.i64
|
|
61
|
+
.wing/
|
|
62
|
+
tasks.py
|
|
63
|
+
|
|
64
|
+
# Local Claude workspace
|
|
65
|
+
.claude/
|
|
66
|
+
agent-responses/
|
|
67
|
+
.venv-*/
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
|
|
2
|
+
# Contributor Covenant Code of Conduct
|
|
3
|
+
|
|
4
|
+
## Our Pledge
|
|
5
|
+
|
|
6
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
7
|
+
|
|
8
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
9
|
+
|
|
10
|
+
## Our Standards
|
|
11
|
+
|
|
12
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
13
|
+
|
|
14
|
+
* Demonstrating empathy and kindness toward other people
|
|
15
|
+
* Being respectful of differing opinions, viewpoints, and experiences
|
|
16
|
+
* Giving and gracefully accepting constructive feedback
|
|
17
|
+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
|
|
18
|
+
* Focusing on what is best not just for us as individuals, but for the overall community
|
|
19
|
+
|
|
20
|
+
Examples of unacceptable behavior include:
|
|
21
|
+
|
|
22
|
+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
23
|
+
* Trolling, insulting or derogatory comments, and personal or political attacks
|
|
24
|
+
* Public or private harassment
|
|
25
|
+
* Publishing others' private information, such as a physical or email address, without their explicit permission
|
|
26
|
+
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
|
27
|
+
|
|
28
|
+
## Enforcement Responsibilities
|
|
29
|
+
|
|
30
|
+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
31
|
+
|
|
32
|
+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
|
|
33
|
+
|
|
34
|
+
## Scope
|
|
35
|
+
|
|
36
|
+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
|
|
37
|
+
|
|
38
|
+
## Enforcement
|
|
39
|
+
|
|
40
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement via GitHub's private vulnerability reporting on this repository (see [SECURITY.md](SECURITY.md) for the link), or by opening a confidential message to a maintainer listed in [CONTRIBUTING.md](CONTRIBUTING.md). All complaints will be reviewed and investigated promptly and fairly.
|
|
41
|
+
|
|
42
|
+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
|
|
43
|
+
|
|
44
|
+
## Enforcement Guidelines
|
|
45
|
+
|
|
46
|
+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
47
|
+
|
|
48
|
+
### 1. Correction
|
|
49
|
+
|
|
50
|
+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
51
|
+
|
|
52
|
+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
|
|
53
|
+
|
|
54
|
+
### 2. Warning
|
|
55
|
+
|
|
56
|
+
**Community Impact**: A violation through a single incident or series of actions.
|
|
57
|
+
|
|
58
|
+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
|
|
59
|
+
|
|
60
|
+
### 3. Temporary Ban
|
|
61
|
+
|
|
62
|
+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
|
|
63
|
+
|
|
64
|
+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
|
|
65
|
+
|
|
66
|
+
### 4. Permanent Ban
|
|
67
|
+
|
|
68
|
+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
69
|
+
|
|
70
|
+
**Consequence**: A permanent ban from any sort of public interaction within the community.
|
|
71
|
+
|
|
72
|
+
## Attribution
|
|
73
|
+
|
|
74
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
|
|
75
|
+
|
|
76
|
+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
|
|
77
|
+
|
|
78
|
+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
|
|
79
|
+
|
|
80
|
+
[homepage]: https://www.contributor-covenant.org
|
|
81
|
+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
|
|
82
|
+
[Mozilla CoC]: https://github.com/mozilla/diversity
|
|
83
|
+
[FAQ]: https://www.contributor-covenant.org/faq
|
|
84
|
+
[translations]: https://www.contributor-covenant.org/translations
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Contributing to mcpyida
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to `mcpyida`. Contributions
|
|
4
|
+
of all kinds are welcome: bug reports, documentation improvements, and code
|
|
5
|
+
patches.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Code of Conduct
|
|
10
|
+
|
|
11
|
+
All interactions in this project are governed by our
|
|
12
|
+
[Code of Conduct](CODE_OF_CONDUCT.md). Please read it before participating.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Development Setup
|
|
17
|
+
|
|
18
|
+
### Prerequisites
|
|
19
|
+
|
|
20
|
+
- Python 3.10 or later
|
|
21
|
+
- An IDA Pro installation (required at runtime for integration/e2e tests; not
|
|
22
|
+
needed for lint/typecheck/unit-test work)
|
|
23
|
+
|
|
24
|
+
### Clone and install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/nightwing-us/mcpyida.git
|
|
28
|
+
cd mcpyida
|
|
29
|
+
pip install -e ".[dev]"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Running the test suite
|
|
33
|
+
|
|
34
|
+
Unit tests (no IDA Pro required):
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pytest tests/unit/ --tb=short
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Integration and e2e tests require IDA Pro / idalib and are run in a CI
|
|
41
|
+
environment with an IDA Pro license available.
|
|
42
|
+
|
|
43
|
+
### Linting
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
ruff check src tests
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Type-checking
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mypy
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
All three commands must pass before submitting a pull request. The CI workflow
|
|
56
|
+
runs them automatically on every PR.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## DCO Sign-Off Requirement
|
|
61
|
+
|
|
62
|
+
This project uses the **Developer Certificate of Origin (DCO)** to confirm that
|
|
63
|
+
contributors have the right to submit their contributions under the project
|
|
64
|
+
license.
|
|
65
|
+
|
|
66
|
+
Every commit in your pull request must carry a `Signed-off-by:` trailer:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
Signed-off-by: Jane Doe <jane@example.com>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The name and email must match your real identity. Add it automatically with
|
|
73
|
+
the `-s` flag:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
git commit -s -m "fix: correct handling of null MCP response"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
By signing off you certify that you agree to the terms at
|
|
80
|
+
<https://developercertificate.org/>. The full DCO text is reproduced there;
|
|
81
|
+
the core statement is: you wrote the code (or have the right to submit it),
|
|
82
|
+
and you grant the project the right to use it under the Apache-2.0 license.
|
|
83
|
+
|
|
84
|
+
**DCO enforcement:** A status check on every pull request verifies that all
|
|
85
|
+
commits are signed off. Pull requests without signed-off commits cannot be
|
|
86
|
+
merged.
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Pull Request Process
|
|
91
|
+
|
|
92
|
+
### Branch naming
|
|
93
|
+
|
|
94
|
+
Use a short, descriptive branch name prefixed with the change type:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
fix/headless-port-assignment
|
|
98
|
+
feat/add-callgraph-tool
|
|
99
|
+
docs/update-installation-guide
|
|
100
|
+
chore/bump-ruff-version
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Commit messages
|
|
104
|
+
|
|
105
|
+
This repository uses [Conventional Commits](https://www.conventionalcommits.org/).
|
|
106
|
+
Please format commit messages as:
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
<type>(<optional scope>): <short description>
|
|
110
|
+
|
|
111
|
+
<optional body>
|
|
112
|
+
|
|
113
|
+
Signed-off-by: Jane Doe <jane@example.com>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Common types: `fix`, `feat`, `docs`, `chore`, `ci`, `refactor`, `test`.
|
|
117
|
+
|
|
118
|
+
### Before pushing
|
|
119
|
+
|
|
120
|
+
Run the full local check suite:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
ruff check src tests
|
|
124
|
+
mypy
|
|
125
|
+
pytest tests/unit/ --tb=short
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Opening the PR
|
|
129
|
+
|
|
130
|
+
- Target the `main` branch.
|
|
131
|
+
- Fill in the PR description with what changed and why.
|
|
132
|
+
- Link any related issues.
|
|
133
|
+
- Ensure all CI checks pass.
|
|
134
|
+
|
|
135
|
+
### How your contribution lands
|
|
136
|
+
|
|
137
|
+
Maintainers review and approve pull requests on GitHub, then integrate
|
|
138
|
+
approved commits via cherry-pick rather than the GitHub "Merge" button.
|
|
139
|
+
As a result your PR will be **closed** (not merged via the button) once
|
|
140
|
+
the change has landed on `main`, and the maintainer will post a comment
|
|
141
|
+
such as:
|
|
142
|
+
|
|
143
|
+
> Landed in v1.2.3 — commit abc1234. Thanks!
|
|
144
|
+
|
|
145
|
+
Your change will appear in the next release. This is intentional and
|
|
146
|
+
does not mean your contribution was rejected.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Code Style
|
|
151
|
+
|
|
152
|
+
- **Formatter:** [ruff](https://docs.astral.sh/ruff/) with the configuration in
|
|
153
|
+
`pyproject.toml` (`[tool.ruff]`).
|
|
154
|
+
- **Type-checking:** [mypy](https://mypy.readthedocs.io/) in gradual mode
|
|
155
|
+
(not `--strict`). Annotations are encouraged but not required everywhere:
|
|
156
|
+
IDA Pro API modules are `Any`-typed via `[[tool.mypy.overrides]]` stubs (the
|
|
157
|
+
IDA Python API has no public type stubs; idalib is dlopen-loaded at runtime),
|
|
158
|
+
and `warn_return_any` is intentionally disabled to avoid ~80 false-positive
|
|
159
|
+
ignores on IDA wrapper return sites. Add annotations to new code and tighten
|
|
160
|
+
existing code incrementally. If you use `Any` outside of IDA-API call sites,
|
|
161
|
+
add an inline comment explaining why and expect discussion in review.
|
|
162
|
+
- **Import ordering:** ruff handles import ordering as part of formatting
|
|
163
|
+
(config in `pyproject.toml` `[tool.ruff]`).
|
|
164
|
+
- **Line length:** 120 characters (prose in docstrings: 80 characters).
|
|
165
|
+
- **String quotes:** single quotes preferred (ruff enforces this).
|
|
166
|
+
|
|
167
|
+
When in doubt, run `ruff check --fix` and `ruff format` to auto-correct most
|
|
168
|
+
style issues before committing.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Reporting Bugs
|
|
173
|
+
|
|
174
|
+
Open an issue on [GitHub Issues](https://github.com/nightwing-us/mcpyida/issues).
|
|
175
|
+
|
|
176
|
+
For security vulnerabilities, see [SECURITY.md](SECURITY.md).
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Questions
|
|
181
|
+
|
|
182
|
+
Feel free to open a GitHub Discussion or comment on a relevant issue.
|