Parsers¶
Package parsers for lockfiles across ecosystems (Python, Node.js, Go, Rust, Java, .NET, Ruby, C/C++).
agent_bom.parsers ¶
Parse package dependencies from MCP server directories.
builtin_inventory_parser_registrations ¶
Return built-in package inventory parser registrations.
Source code in src/agent_bom/parsers/__init__.py
register_inventory_parser ¶
Register an inventory parser with capability metadata.
list_registered_inventory_parsers ¶
Return registered inventory parsers with capability declarations.
Source code in src/agent_bom/parsers/__init__.py
inventory_parser_registry_warnings ¶
Return sanitized non-fatal registry loading warnings.
detect_docker_image_package ¶
Extract the image reference from docker/podman MCP server commands.
Source code in src/agent_bom/parsers/__init__.py
lookup_mcp_registry ¶
Look up an MCP server's packages using the bundled registry.
Matches on: 1. Exact npm package name in args (e.g. @modelcontextprotocol/server-filesystem) 2. command_patterns substring match against server name or args
Preserves the registry's latest_version in registry_version for drift comparison, and tries to detect the actual installed version from args. If no installed version is detectable, version is set to "latest" so the resolver can query npm/PyPI for the real current version.
Source code in src/agent_bom/parsers/__init__.py
get_registry_entry ¶
Return the full registry entry for an MCP server, or None.
Source code in src/agent_bom/parsers/__init__.py
find_server_directory ¶
Attempt to find the MCP server's source directory.
Source code in src/agent_bom/parsers/__init__.py
extract_packages ¶
extract_packages(server: MCPServer, resolve_transitive: bool = False, max_depth: int = 3, smithery_token: str | None = None, mcp_registry: bool = False) -> list[Package]
Extract all packages for an MCP server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server
|
MCPServer
|
The MCP server to extract packages from |
required |
resolve_transitive
|
bool
|
If True, resolve transitive dependencies for npx/uvx packages |
False
|
max_depth
|
int
|
Maximum depth for transitive dependency resolution |
3
|
smithery_token
|
str | None
|
Optional Smithery API key for live registry fallback |
None
|
mcp_registry
|
bool
|
If True, query the Official MCP Registry as a fallback |
False
|
Source code in src/agent_bom/parsers/__init__.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 | |
summarize_project_inventory ¶
Summarize manifest/lockfile coverage for a project scan.
This keeps lockfile-driven project scanning visible in CLI/JSON output so users can tell whether a project scan was backed by resolved lockfiles or only manifest declarations.
Source code in src/agent_bom/parsers/__init__.py
696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | |
scan_project_directory ¶
Recursively walk root for package manifests and parse all packages.
Returns a mapping of {directory: [Package, ...]} for each directory
that contains at least one supported manifest file. Directories in
_SKIP_DIRS and hidden directories (starting with .) beyond the
root are silently skipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
Project root directory to scan. |
required |
max_depth
|
int
|
Maximum directory depth to descend (default 5). |
5
|
Returns:
| Type | Description |
|---|---|
dict[Path, list[Package]]
|
Dict mapping each manifest-bearing directory to its parsed packages. |
dict[Path, list[Package]]
|
Empty dict if no manifests are found. |
Source code in src/agent_bom/parsers/__init__.py
791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 | |