MCPFinanceiro

MCPFinanceiro

A server for managing financial accounting entries that provides utilities for database access using SQLAlchemy with environment-based configuration.

Category
Visit Server

README

MCP API

API de CRUD de Pessoas protegida por JWT, construída com FastAPI, SQLAlchemy e Alembic.

🚀 Visão Geral

  • Linguagem: Python 3.11
  • Framework: FastAPI
  • Banco de Dados: SQLite (mcp.db)
  • ORM: SQLAlchemy + Alembic
  • Documentação: Swagger UI (OpenAPI)
  • Autenticação: JWT (Bearer)
  • Servidor MCP: compatível com o MCP Client Tool do n8n, permitindo que fluxos de IA registrem clientes automaticamente no banco de dados via n8n

📂 Estrutura do Projeto

meu_projeto/
├── .env                      # Variáveis de ambiente
├── requirements.txt          # Dependências Python
├── Dockerfile                # Imagem Docker
├── docker-compose.yml        # Orquestração com Traefik
├── run.py                    # Entry-point do FastAPI
└── app/
    ├── config.py            # Pydantic Settings
    ├── database.py          # Engine, Session e Base
    ├── models/              # Modelos SQLAlchemy
    ├── schemas/             # Schemas Pydantic
    ├── crud/                # Funções de acesso ao BD
    └── api/                 # Rotas e dependências de segurança

⚙️ Pré-requisitos

  • Python 3.11+
  • pip
  • Docker & Docker Compose (opcional para container)

🔧 Instalação Local

  1. Clone o repositório:

    git clone <SEU_REPO_URL>
    cd meu_projeto
    
  2. Crie e ative um virtualenv:

    python3 -m venv .venv
    source .venv/bin/activate  # Linux/macOS
    .venv\Scripts\activate.bat # Windows
    
  3. Instale dependências:

    pip install --upgrade pip
    pip install -r requirements.txt
    
  4. Configure seu .env (exemplo em .env.example):

    SECRET_KEY=uma_senha_supersecreta
    ALGORITHM=HS256
    ACCESS_TOKEN_EXPIRE_MINUTES=60
    DATABASE_URL=sqlite:///./mcp.db
    
  5. Gere o banco e suba o servidor:

    uvicorn run:app --reload
    

🌐 Uso com Docker Compose

  1. Build e up:

    docker-compose build
    docker-compose up -d
    
  2. Acesse em https://mcpfinanceiro.adjunto.com.br ou http://localhost:8000.

📑 Documentação & Swagger UI

  • OpenAPI JSON: /openapi.json

  • Swagger UI: /docs

    • Clique em Authorize, cole apenas o JWT.
    • Depois faça chamadas às rotas de /pessoas.

🔐 Autenticação JWT

  • Esquema: Bearer JWT
  • Components/securitySchemes: bearerAuth
  • As operações usam Security(get_current_user) e global security no OpenAPI.

Geração de Token (externa)

Exemplo de geração manual:

python3 - << 'PYCODE'
import jwt, datetime
SECRET_KEY = "uma_senha_supersecreta"
ALGORITHM = "HS256"
payload = {"sub":"usuario", "exp": datetime.datetime.utcnow() + datetime.timedelta(hours=1)}
print(jwt.encode(payload, SECRET_KEY, algorithm=ALGORITHM))
PYCODE

📝 Endpoints Principais

Método Rota Operation ID Descrição
POST /pessoas/ createPessoa Cria nova pessoa
GET /pessoas/ listPessoas Lista pessoas
GET /pessoas/{id} getPessoaById Busca pessoa por ID
PATCH /pessoas/{id} updatePessoa Atualiza campos da pessoa
DELETE /pessoas/{id} deletePessoa Remove pessoa

📂 Migrações com Alembic

  1. Inicializar repo:

    alembic init migrations
    
  2. Criar migration:

    alembic revision --autogenerate -m "Descrição"
    
  3. Aplicar:

    alembic upgrade head
    

⚖️ Licença

MIT License © Adjunto Sistemas

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured