Metadata-Version: 2.4
Name: mcp-meroshare
Version: 0.1.1
Summary: MCP server for MeroShare (CDSC Nepal) — IPO/FPO applications, portfolio, and share management
Author-email: Tek Prasad Chapagain <tekchapagain1@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/tekchapagain1/mcp-meroshare
Project-URL: Repository, https://github.com/tekchapagain1/mcp-meroshare
Project-URL: Issues, https://github.com/tekchapagain1/mcp-meroshare/issues
Keywords: mcp,meroshare,nepal,cdsc,ipo,stock,nepse
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Financial and Insurance Industry
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Office/Business :: Financial :: Investment
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: mcp>=1.0.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dotenv>=1.0

# mcp-meroshare

MCP (Model Context Protocol) server for [MeroShare](https://meroshare.cdsc.com.np) — Nepal's online share application system by CDSC Nepal.

Use it through opencode or any MCP-compatible client to manage IPO/FPO applications, portfolio, and share transactions directly from your AI tools.

## Features

- **IPO/FPO Application** — view open issues, apply with dry-run support
- **Portfolio** — check your holdings and transaction history
- **Account** — view DP list, own details, linked bank accounts

## Tools

| Tool | Description |
|---|---|
| `meroshare_get_dp_list` | List all DPs with their numeric client IDs |
| `meroshare_login` | Log in (password read from `.env`) |
| `meroshare_logout` | Clear session |
| `meroshare_get_current_issues` | Open IPO/FPO/Rights issues |
| `meroshare_apply_ipo` | Apply for an issue (with dry-run) |
| `meroshare_get_bank_details` | Linked bank account info |
| `meroshare_get_own_detail` | Your profile (BOID, demat, email) |
| `meroshare_get_transactions` | Share transaction history |

## Installation

```bash
pip install mcp-meroshare
```

## Setup

1. Create a `.env` file in the directory where you'll run opencode:

```env
MERO_SHARE_CLIENT_ID=162
MERO_SHARE_USERNAME="your_boid"
MERO_SHARE_PASSWORD="your_password"
MERO_SHARE_CRN_NUMBER="your_casba_crn"
MERO_SHARE_TRANSACTION_PIN="your_tpin"
```

> Find your `client_id` by calling `meroshare_get_dp_list`.

2. Lock the file: `chmod 600 .env`

3. Add to your `opencode.json`:

```json
{
  "mcp": {
    "meroshare": {
      "type": "local",
      "command": ["python3", "-m", "mcp_meroshare"],
      "enabled": true
    }
  }
}
```

4. Run opencode in that directory and call `meroshare_login` with your `client_id` and `username`.

## Security

- Credentials are read **only from `.env`** — never passed as tool arguments
- Session auto-expires after 15 minutes of inactivity
- `.env` file permission warning if world-readable

## License

MIT
