An AI-native Model Context Protocol (MCP) server that integrates SAM.gov and USASpending.gov APIs to capture and analyze federal procurement and spending data through natural language queries.
Capture MCP empowers non-technical users to capture and query federal entity, opportunity, and spending data through LLM applications like Claude Desktop. It provides 10 specialized tools that can search, analyze, and join data from both government APIs.
- search_sam_entities - Find federal contractors and businesses
- get_sam_opportunities - Discover contract opportunities
- get_sam_entity_details - Get comprehensive company profiles
- check_sam_exclusions - Verify contractor eligibility
- get_usaspending_awards - Agency award summaries
- get_usaspending_spending_by_category - Spending breakdowns
- get_usaspending_budgetary_resources - Budget information
- search_usaspending_awards_by_recipient - Find awards by company
- get_entity_and_awards - Combine SAM entity data with spending history
- get_opportunity_spending_context - Link opportunities with market context
- Node.js 18+
- SAM.gov API key (Get one here)
- Clone and install:
git clone https://github.com/blencorp/capture-mcp-server.git
cd capture-mcp-server
npm install
- Configure environment:
cp .env.example .env
# Edit .env and add your SAM_GOV_API_KEY
- Build and start:
npm run build
npm start
Add to your Claude Desktop MCP settings:
{
"mcpServers": {
"capture-mcp-server": {
"command": "node",
"args": ["/path/to/capture-mcp-server/dist/server.js"],
"env": {
"SAM_GOV_API_KEY": "your-api-key-here"
}
}
}
}
For enhanced branding with custom logo and display name:
- Create the extension package:
npm run build
zip -r capture-mcp-server.dxt dist/ manifest.json assets/
- Install the .dxt file in Claude Desktop by dragging the
capture-mcp-server.dxt
file to the MCP connectors section
The Desktop Extension format provides:
- Custom display name: "Capture MCP Server"
- Professional logo and branding
- Rich metadata and descriptions
- Enhanced user experience
Once integrated with Claude Desktop, you can ask natural language questions like:
- "Find janitorial service contracts awarded to service-disabled veteran-owned businesses in the past 6 months"
- "What's the total federal spending on cybersecurity contracts in fiscal year 2023?"
- "List all 8(a) set-aside opportunities from federal agencies posted in the last 30 days"
- "What was the total obligated spending by HHS on cloud computing last fiscal year?"
- "Show me recent contract awards for 'penetration testing' under $250,000"
- "Find food service and catering contracts awarded to small businesses"
- "What are the active landscaping maintenance contracts in Florida?"
- "Show me building maintenance and repair contracts over $100,000 awarded this year"
Search for federal contractors and businesses.
- Required:
api_key
- Optional:
query
,state
,naics
,uei
,limit
Find federal contract opportunities.
- Required:
api_key
,posted_from
,posted_to
- Optional:
keyword
,set_aside
,state
,limit
Get comprehensive details for a specific entity.
- Required:
api_key
,uei
Check if an entity is excluded from federal contracting.
- Required:
api_key
- Optional:
uei
,entity_name
Get agency award summaries.
- Required:
agency_code
- Optional:
fiscal_year
,limit
Get spending breakdown by category.
- Required:
agency_code
- Optional:
fiscal_year
Get agency budget information.
- Required:
agency_code
- Optional:
fiscal_year
Search awards by recipient name.
- Required:
recipient_name
- Optional:
fiscal_year
,min_amount
,max_amount
,award_types
,limit
Combine SAM entity data with USASpending award history.
- Required:
api_key
,uei
- Optional:
fiscal_year
,award_limit
Link opportunities with historical spending context.
- Required:
api_key
- Required One Of:
opportunity_id
ORsolicitation_number
- Optional:
fiscal_year
# Development mode with auto-reload
npm run dev
# Build TypeScript
npm run build
# Run built server
npm start
The MCP Inspector is a powerful debugging tool for MCP servers. It provides a web-based interface to test your tools without needing Claude Desktop.
- Install MCP Inspector globally:
npm install -g @modelcontextprotocol/inspector
- Start the MCP server with Inspector:
npx @modelcontextprotocol/inspector node dist/server.js
-
Open the Inspector interface:
- Navigate to http://localhost:5173 in your browser
- The Inspector will automatically connect to your MCP server
-
Configure environment variables:
- Click on the "Environment" tab in the Inspector
- Add your
SAM_GOV_API_KEY
environment variable
The MCP Inspector allows you to:
- View available tools: See all 10 tools with their descriptions and schemas
- Test tool calls: Execute tools directly with a user-friendly form interface
- Inspect responses: View formatted JSON responses and error messages
- Debug issues: See detailed request/response logs for troubleshooting
Example workflow:
- Select a tool like
search_sam_entities
from the tools list - Fill in the required parameters (e.g.,
api_key
,query
) - Click "Execute" to run the tool
- View the response in the output panel
This is especially useful for:
- Testing new tool implementations
- Debugging API integration issues
- Understanding tool schemas and responses
- Demonstrating capabilities to stakeholders
The server implements comprehensive error handling:
- Rate limiting for both APIs
- Input sanitization and validation
- Structured JSON error responses
- Graceful degradation when APIs are unavailable
- Token optimized: Responses filtered to essential fields
- Rate limited: Respects API limits (SAM: key-dependent, USASpending: ~1000/hr)
- Async operations: All API calls are non-blocking
- Pagination: Default limits prevent oversized responses
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details.
For issues, questions, or contributions, please visit our GitHub repository.
Built with ❤️ by BLEN.
BLEN, Inc is a digital services company that provides Emerging Technology (ML/AI, RPA), Digital Modernization (Legacy to Cloud) and Human-Centered Web/Mobile Design and Development.
Happy hunting! 🎯