MCP NIF.PT
Query and analyze Portuguese companies using the NIF.PT public API. Supports search by NIF, company name, and city.
MCP NIF.PT
This project implements an intelligent server based on FastMCP, allowing you to query and analyze information about Portuguese companies using the NIF.PT public API. It supports multiple useful tools such as search by NIF, company name or city, checking company status, and identifying accounting-related businesses.
Features
- Retrieve complete company data by NIF
- Check if a company is active or closed
- Identify if a company is related to accounting
- Search companies by name and city
- Get the NIF based on the exact company name
- Access external links (Google Maps, Racius, Portugalio)
Project Structure
.
├── main.py
├── models.py
├── nif_client.py
├── utils.py
├── requirements.txt
├── Dockerfile
├── package.json
└── .smithery.profile.json
Technologies Used
- FastMCP
- FastAPI
- httpx
- Pydantic
- Docker
- Python 3.10+
How to Run
Locally
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py
The application uses transport="stdio" by default, making it compatible with Claude Desktop or terminal-based environments.
Usage Examples
- Qual é a empresa com o NIF 504426744?
- A empresa com o NIF 504426744 está ativa?
- A empresa com o NIF 504426744 é de contabilidade?
- Procurar empresas com o nome "contabilidade" em Lisboa
- Qual é o NIF da empresa "XPTO LDA"?
Output Format
The responses include details such as:
- Nome, cidade, atividade e estado
- Morada com link para Google Maps
- Contactos (telefone, email, website)
- CAE (Código de Atividade Económica)
- Ligações externas (Racius, Portugalio)
Claude Desktop Integration
To integrate this MCP with Claude Desktop:
-
Install Claude Desktop
Download and install from: https://claude.ai/download -
Open Configuration
Go toFile > Settings > Developerand click Edit Configuration -
Add the MCP server configuration
In theclaude_desktop_config.json, insert the following configuration:
{
"mcpServers": {
"nif-pt-server": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/YOUR/PROJECT/FOLDER",
"run",
"main.py"
]
}
}
}
Replace
/ABSOLUTE/PATH/TO/YOUR/PROJECT/FOLDERwith the actual absolute path where yourmain.pyfile is located.
- Restart Claude Desktop
After saving the configuration, restart Claude Desktop. Yournif-pt-serverMCP should now be available in the Claude Desktop interface.
One-Click Installation via Smithery
(https://smithery.ai/server/@ruicarvalho1/mcp_nif)
With Claude Desktop open, you can install this MCP directly using the Smithery CLI.
Just paste the following command into your terminal:
npx -y @smithery/cli@latest install @ruicarvalho1/mcp_nif --client claude
This will automatically install the MCP and register it with Claude Desktop.
Author
Developed by Rui Carvalho.
License
This project is licensed under the MIT License.
Related Servers
IACR ePrint Archive
Search and retrieve cryptographic research papers from the IACR Cryptology ePrint Archive.
Mastra Docs Server
Provides AI assistants with direct access to Mastra.ai's complete knowledge base.
Legislative Yuan API
Search for bills, documents, and meeting records from Taiwan's Legislative Yuan API.
Perplexity MCP Server
Web search using Perplexity's API.
Rememberizer MCP Server for Common Knowledge
Access and search personal or team knowledge repositories, including documents and Slack discussions, using semantic search and retrieval tools.
Perplexity
An MCP server that connects to Perplexity's Sonar API, enabling real-time web-wide research in conversational AI.
鸣潮 MCP Server
Retrieves character and artifact information from the game Wuthering Waves (鸣潮) as Markdown, optimized for large language models.
Claude Web Search
Provides web search functionality powered by the Claude API from Anthropic.
Legal MCP Server Argentina
A server for intelligent search and jurisprudence analysis of Argentine legal documents.
ReActMCP Web Search
A web search server that integrates with the Exa API to perform basic and advanced searches.